Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3761124

Browse files
Tim TsaiLee-W
Tim Tsai
authored andcommitted
fix(base.py): add encoding when open changlelog_file
#1110
1 parent ee14038 commit 3761124

File tree

1 file changed

+2
-1
lines changed
  • commitizen/changelog_formats

1 file changed

+2
-1
lines changed

‎commitizen/changelog_formats/base.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, config: BaseConfig):
2424
# Constructor needs to be redefined because `Protocol` prevent instantiation by default
2525
# See: https://bugs.python.org/issue44807
2626
self.config = config
27+
self.encoding = self.config.settings["encoding"]
2728

2829
@property
2930
def version_parser(self) -> Pattern:
@@ -33,7 +34,7 @@ def get_metadata(self, filepath: str) -> Metadata:
3334
if not os.path.isfile(filepath):
3435
return Metadata()
3536

36-
with open(filepath) as changelog_file:
37+
with open(filepath, encoding=self.encoding) as changelog_file:
3738
return self.get_metadata_from_file(changelog_file)
3839

3940
def get_metadata_from_file(self, file: IO[Any]) -> Metadata:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /