Repository navigation
PyREPL raises exception while trying to write to the history file on a read-only file system #128066
Copy link
Copy link
Closed
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Dec 18, 2024 - addedtopic-replRelated to the interactive shellRelated to the interactive shell
on Dec 18, 2024 - added3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes
on Dec 18, 2024 I think the easiest fix would be to catch
OSErrors there, and just log a warning if something goes wrong.It's silly that we get this error only at the end of session.
Rather than catch OSError, maybe we should map EROFS errno to PermissionError on Linux. (Call to write_history_file() is wrapped with
except (FileNotFoundError, PermissionError).)- added a commit that references this issue
on Apr 11, 2025 Fix in hand. Tested locally by stealing the official Python image build dockerfile but using my own modified tarball with the fix.
╭─cpatti at rocinante in ~/src/personal 25-05-20 - 14:18:58 ╰─○ docker run -it --read-only pyrepl_tst python3 <region:us-east-1> zsh: correct 'python3' to 'python' [nyae]? n Python 3.15.0a0 (heads/cpatti_issue_128066-dirty:01225ff4a74, May 20 2025, 18:17:11) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print("Hellorld!") Hellorld! >>>- added a commit that references this issue
on May 20, 2025
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
When using new Python 3.13
pyreplon a read-only file system, attempting to exit the REPL raises the following exception:OSError: [Errno 30] Read-only file system: '/root/.python_history'. The same setup works with Python 3.12.CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Linux
Linked PRs