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

Fixes #7473 FileNotFoundError when displaying the settings page #7474

Merged
merged 1 commit into from Jun 12, 2023

Conversation

kozlovsky
Copy link
Collaborator

This PR fixes #7473

@kozlovsky kozlovsky requested a review from a team as a code owner June 11, 2023 12:25
@kozlovsky kozlovsky requested review from xoriole and removed request for a team June 11, 2023 12:25
Comment on lines 60 to 66
if os.path.exists(p):
try:
size += os.path.getsize(p)
except FileNotFoundError:
# In rare cases of race condition, it is possible that the file, such as
# `sqlite/knowledge.db-journal`, was deleted right after the `os.path.exists` check.
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: with the new code version the check if os.path.exists(p): could be safely omitted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed

@kozlovsky kozlovsky merged commit ad0354f into Tribler:release/7.13 Jun 12, 2023
13 of 17 checks passed
@kozlovsky kozlovsky deleted the fix/path_size branch June 12, 2023 08:51
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.

None yet

2 participants