Skip to content

Commit 090ca57

Browse files
Added warning on failing to write REPL history file at exit
1 parent e1a74c5 commit 090ca57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/site.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,10 @@ def register_readline():
578578
def write_history():
579579
try:
580580
readline_module.write_history_file(history)
581-
except (FileNotFoundError, PermissionError):
581+
except (FileNotFoundError, PermissionError, OSError) as e:
582582
# home directory does not exist or is not writable
583583
# https://bugs.python.org/issue19891
584-
pass
584+
_warn(f'failed to open the history file for writing: {e}', RuntimeWarning)
585585

586586
atexit.register(write_history)
587587

0 commit comments

Comments
 (0)