Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb41e7b1

Browse files
ambvfeoh
andauthored
[3.13]gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380) (gh-134386)
(cherry picked from commitc91ad5d)Co-authored-by: Chris Patti <feoh@feoh.org>Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent7df6749 commitb41e7b1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

‎Lib/site.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import_sitebuiltins
7676
importio
7777
importstat
78+
importerrno
7879

7980
# Prefixes for site-packages; add additional prefixes like /usr/local here
8081
PREFIXES= [sys.prefix,sys.exec_prefix]
@@ -576,6 +577,11 @@ def write_history():
576577
# home directory does not exist or is not writable
577578
# https://bugs.python.org/issue19891
578579
pass
580+
exceptOSError:
581+
iferrno.EROFS:
582+
pass# gh-128066: read-only file system
583+
else:
584+
raise
579585

580586
atexit.register(write_history)
581587

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fixes an edge case where PyREPL improperly threw an error when Python is
2+
invoked on a read only filesystem while trying to write history file
3+
entries.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp