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 f028055

Browse files
feat(changelog.py): add encoding to get_metadata
1 parent ba34852 commit f028055

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎commitizen/changelog.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ def parse_title_type_of_line(value: str) -> str | None:
213213
return m.groupdict().get("title")
214214

215215

216-
def get_metadata(filepath: str, scheme: VersionScheme = Pep440) -> dict:
216+
def get_metadata(
217+
filepath: str, scheme: VersionScheme = Pep440, encoding: str = "utf-8"
218+
) -> dict:
217219
unreleased_start: int | None = None
218220
unreleased_end: int | None = None
219221
unreleased_title: str | None = None
@@ -227,7 +229,7 @@ def get_metadata(filepath: str, scheme: VersionScheme = Pep440) -> dict:
227229
"latest_version_position": None,
228230
}
229231

230-
with open(filepath, "r") as changelog_file:
232+
with open(filepath, "r", encoding=encoding) as changelog_file:
231233
for index, line in enumerate(changelog_file):
232234
line = line.strip().lower()
233235

0 commit comments

Comments
(0)

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