Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
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]
Expand Down Expand Up @@ -576,6 +577,11 @@ def write_history():
# 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)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixes an edge case where PyREPL improperly threw an error when Python is
invoked on a read only filesystem while trying to write history file
entries.
Loading