We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02c4eae commit e20d31cCopy full SHA for e20d31c
2 files changed
Lib/site.py
@@ -418,7 +418,16 @@ def register_readline():
418
readline.read_history_file(history)
419
except IOError:
420
pass
421
- atexit.register(readline.write_history_file, history)
+
422
+ def write_history():
423
+ try:
424
+ readline.write_history_file(history)
425
+ except (FileNotFoundError, PermissionError):
426
+ # home directory does not exist or is not writable
427
+ # https://bugs.python.org/issue19891
428
+ pass
429
430
+ atexit.register(write_history)
431
432
sys.__interactivehook__ = register_readline
433
Misc/NEWS.d/next/Library/2018-07-26-08-45-49.bpo-19891.Y-3IiB.rst
@@ -0,0 +1,2 @@
1
+Ignore errors caused by missing / non-writable homedir while writing history
2
+during exit of an interactive session. Patch by Anthony Sottile.
0 commit comments