cpython/Include/internal
Victor Stinner 6f7346bb39
[3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616)
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

(cherry picked from commit c353764fd5)

* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

(cherry picked from commit fa7ab6aa0f)
2020-06-03 18:28:18 +02:00
..
pycore_accu.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_atomic.h bpo-33608: Normalize atomic macros so that they all expect an atomic struct (GH-12877) 2019-04-22 11:13:11 -07:00
pycore_ceval.h Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (gh-13714)" (GH-13780) 2019-06-03 18:14:24 +02:00
pycore_code.h bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884) 2019-06-03 21:30:58 +09:00
pycore_condvar.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_context.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_fileutils.h bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422) 2019-03-19 01:46:25 +01:00
pycore_getopt.h bpo-36763: Cleanup precmdline in _PyCoreConfig_Read() (GH-13371) 2019-05-17 03:15:12 +02:00
pycore_gil.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_hamt.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_initconfig.h bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509) 2019-10-01 03:26:04 -07:00
pycore_object.h bpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623) 2019-10-07 21:12:05 +02:00
pycore_pathconfig.h [3.8] bpo-38234: Backport init path config changes from master (GH-16423) 2019-09-26 16:17:34 +02:00
pycore_pyerrors.h bpo-36710: Add tstate parameter in ceval.c (GH-13547) 2019-05-24 17:01:38 +02:00
pycore_pyhash.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_pylifecycle.h bpo-38317: Fix PyConfig.warnoptions priority (GH-16478) 2019-09-29 16:58:57 -07:00
pycore_pymem.h [3.8] bpo-36389: Backport debug enhancements from master (GH-16796) 2019-10-15 03:06:16 +02:00
pycore_pystate.h [3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616) 2020-06-03 18:28:18 +02:00
pycore_traceback.h bpo-36829: PyErr_WriteUnraisable() normalizes exception (GH-13507) 2019-05-23 01:00:58 +02:00
pycore_tupleobject.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_warnings.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00