mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
c7f8e706e1
commit
c91ad5da9d
3 changed files with 12 additions and 1 deletions
|
@ -31,6 +31,7 @@ import os
|
|||
import sys
|
||||
import code
|
||||
import warnings
|
||||
import errno
|
||||
|
||||
from .readline import _get_reader, multiline_input, append_history_file
|
||||
|
||||
|
@ -153,6 +154,7 @@ def run_multiline_interactive_console(
|
|||
append_history_file()
|
||||
except (FileNotFoundError, PermissionError, OSError) as e:
|
||||
warnings.warn(f"failed to open the history file for writing: {e}")
|
||||
|
||||
input_n += 1
|
||||
except KeyboardInterrupt:
|
||||
r = _get_reader()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue