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]
# 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)
--- /dev/null
+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.