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

fix #443 #447

Closed
wants to merge 1 commit into from
Closed

fix #443 #447

wants to merge 1 commit into from

Conversation

lgc2333
Copy link

@lgc2333 lgc2333 commented Apr 11, 2023

No description provided.

Copy link
Collaborator

@pseusys pseusys left a 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:
Copy link
Collaborator

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?

Copy link
Author

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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

@lgc2333
Copy link
Author

lgc2333 commented Apr 12, 2023

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.

ok, i'll close this pr

@lgc2333 lgc2333 closed this Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants