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

Specify UTF-8 encoding in Python script #808

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
readme_summary_text = f"There are currently {len(svg_list)} icons and the average size is _under_ {round(total_bytes / len(svg_list))} bytes!"

# Replace the table in README with the new one
with open('README.md','r+') as f:
with open('README.md','r+', encoding="utf-8") as f:
file = f.read()

file = re.sub(r"(?s)<table>.*?</table>", readme_table, file)
Expand All @@ -122,7 +122,7 @@
print(f"README.md updated with {len(svg_list)} icons.")

# Replace the tables in the REFERENCE document
with open('REFERENCE.md','r+') as f:
with open('README.md','r+', encoding="utf-8") as f:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be REFERENCE.

file = f.read()

file = re.sub(r"(?s)-\|-\|-.*", reference_table, file)
Expand All @@ -135,7 +135,7 @@
print(f"REFERENCE.md updated.")

# Replace the table in the CHECK document
with open('CHECK.html','r+') as f:
with open('README.md','r+', encoding="utf-8") as f:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be CHECK

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, wonder how those happened. Thanks for the catch.

file = f.read()

file = re.sub(r"(?s)<table>.*?</table>", check_table, file)
Expand Down
Loading