Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly specify UTF-8 for citation generation #2578

Merged
merged 3 commits into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2578.bugfix.rst
@@ -0,0 +1 @@
Required UTF-8 encoding to be used for generating citation output.
4 changes: 2 additions & 2 deletions docs/_cff_to_rst.py
Expand Up @@ -30,7 +30,7 @@ def parse_cff(filename: str) -> dict[str, str | list[dict[str, str]]]:
`dict`
A dictionary containing the parsed data from :file:`CITATION.cff`.
"""
with pathlib.Path(filename).open() as stream:
with pathlib.Path(filename).open(encoding="utf-8") as stream:
return yaml.safe_load(stream)


Expand Down Expand Up @@ -188,7 +188,7 @@ def main(cff_file="../CITATION.cff", rst_file="about/_authors.rst", verbose=Fals
if verbose:
print(authors_rst) # noqa: T201

with pathlib.Path(rst_file).open("w") as file:
with pathlib.Path(rst_file).open("w", encoding="utf-8") as file:
file.write(authors_rst)


Expand Down