-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
fix #443 #447
fix #443 #447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest moving to the new PR #449 I've just created - it checks and filters out None repositories as soon as they are received, that is, in one place, instead of constantly checking for None across the codebase.
@@ -107,12 +107,12 @@ def update_readme(stats: str): | |||
DBM.i("Updating README...") | |||
readme_path = join(GitHubManager.REPO.working_tree_dir, GitHubManager.REMOTE.get_readme().path) | |||
|
|||
with open(readme_path, "r") as readme_file: | |||
with open(readme_path, "r", encoding="utf-8") as readme_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular reason for specifying encoding explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my computer's default encoding is gbk
, so i wrote this
readme_contents = readme_file.read() | ||
readme_stats = f"{GitHubManager._START_COMMENT}\n{stats}\n{GitHubManager._END_COMMENT}" | ||
new_readme = sub(GitHubManager._README_REGEX, readme_stats, readme_contents) | ||
|
||
with open(readme_path, "w") as readme_file: | ||
with open(readme_path, "w", encoding="utf-8") as readme_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
ok, i'll close this pr |
No description provided.