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 336c945 commit b249966Copy full SHA for b249966
2 files changed
Lib/site.py
@@ -439,7 +439,16 @@ def register_readline():
439
readline.read_history_file(history)
440
except OSError:
441
pass
442
- atexit.register(readline.write_history_file, history)
+
443
+ def write_history():
444
+ try:
445
+ readline.write_history_file(history)
446
+ except (FileNotFoundError, PermissionError):
447
+ # home directory does not exist or is not writable
448
+ # https://bugs.python.org/issue19891
449
+ pass
450
451
+ atexit.register(write_history)
452
453
sys.__interactivehook__ = register_readline
454
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