FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-128066: Fixed PyREPL history saving on read-only file systems by vladimir-poghosyan · Pull Request #128088 · python/cpython · GitHub

Repository navigation

gh-128066: Fixed PyREPL history saving on read-only file systems - #128088

Closed
vladimir-poghosyan wants to merge 7 commits into
python:mainfrom
vladimir-poghosyan:fix-issue-128066
Closed

vladimir-poghosyan wants to merge 7 commits into
python:mainfrom
vladimir-poghosyan:fix-issue-128066

Conversation

vladimir-poghosyan commented Dec 19, 2024 •
edited
Loading

Copy link
Copy Markdown

As suggested in the comment of the linked issue by @ZeroIntensity, I simply handled the exception with a resulting warning.

ghost commented Dec 19, 2024 •
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

Comment thread Lib/_pyrepl/readline.py Outdated

skirpichev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM in general, with few concerns.

  1. Maybe it worth a test.
  2. I worry, that error is too late. Though, this will be fixed by #132294.

Copy link
Copy Markdown
Author

Thank you for reviewing the PR.

I looked through your mentioned pull request an noticed that the call to append_history_file is wrapped in except (FileNotFoundError, PermissionError) exception handler, thus still prone to the same read-only file system error, or am I missing something?

Will it be better, that I add OSError to the except (FileNotFoundError, PermissionError) in the site.py (where the write_history_file is called) with a warning message and leave its implementation as it was? In that way file handling code in both write_history_file and append_history_file methods will match.

Copy link
Copy Markdown
Member

I looked through your mentioned pull request an noticed that the call to append_history_file is wrapped in except (FileNotFoundError, PermissionError) exception handler

Now I also catch OSError like in your pr.

Will it be better, that I add OSError to the except (FileNotFoundError, PermissionError) in the site.py

Hmm, maybe. (BTW I doubt that FileNotFoundError is relevant at all.)

vladimir-poghosyan commented Apr 11, 2025 •
edited
Loading

Copy link
Copy Markdown
Author

I've changed my implementation and moved error handling to the site.py. Regarding the the FileNotFoundError being caught, I think that it is relevant for missing directories in the history file path.

ambv commented May 20, 2025

Copy link
Copy Markdown
Contributor

Closing in favor of #134380.

ambv closed this May 20, 2025
vladimir-poghosyan deleted the fix-issue-128066 branch May 31, 2025 12:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL