mirror of
https://github.com/python/cpython.git
synced 2025-09-08 01:41:19 +00:00
[3.13] gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380) (gh-134386)
(cherry picked from commit c91ad5da9d
)
Co-authored-by: Chris Patti <feoh@feoh.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
7df6749219
commit
b41e7b1e02
2 changed files with 9 additions and 0 deletions
|
@ -75,6 +75,7 @@ import builtins
|
|||
import _sitebuiltins
|
||||
import io
|
||||
import stat
|
||||
import errno
|
||||
|
||||
# Prefixes for site-packages; add additional prefixes like /usr/local here
|
||||
PREFIXES = [sys.prefix, sys.exec_prefix]
|
||||
|
@ -576,6 +577,11 @@ def register_readline():
|
|||
# home directory does not exist or is not writable
|
||||
# https://bugs.python.org/issue19891
|
||||
pass
|
||||
except OSError:
|
||||
if errno.EROFS:
|
||||
pass # gh-128066: read-only file system
|
||||
else:
|
||||
raise
|
||||
|
||||
atexit.register(write_history)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue