cpython/Include
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
..
cpython bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136) 2020-03-24 17:12:19 +01:00
internal [3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616) 2020-06-03 18:28:18 +02:00
Python-ast.h bpo-37593: Swap the positions of posonlyargs and args in the constructor of ast.parameters nodes (GH-14778) 2019-07-14 16:49:52 -07:00
Python.h bpo-36763: Implement the PEP 587 (GH-13592) 2019-05-27 16:39:22 +02:00
abstract.h [3.8] bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950) (GH-16999) 2019-10-30 21:36:33 +02:00
asdl.h bpo-18407: ast.c uses Py_ssize_t for asdl_seq_LEN() iterator (GH-10655) 2018-11-22 14:45:16 +01:00
ast.h
bitset.h bpo-36623: Clean parser headers and include files (GH-12253) 2019-04-13 17:05:14 +01:00
bltinmodule.h
boolobject.h
bytearrayobject.h
bytes_methods.h
bytesobject.h
cellobject.h
ceval.h bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980) 2019-05-28 17:16:33 +02:00
classobject.h bpo-36974: implement PEP 590 (GH-13185) 2019-05-29 20:31:52 +02:00
code.h [3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) (GH-19835) 2020-05-01 07:18:27 -07:00
codecs.h
compile.h [3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) (GH-19835) 2020-05-01 07:18:27 -07:00
complexobject.h
context.h
datetime.h
descrobject.h [3.8] bpo-36974: separate vectorcall functions for each calling convention (GH-13781) (#14782) 2019-07-23 12:39:51 +02:00
dictobject.h
dtoa.h
dynamic_annotations.h
enumobject.h
errcode.h
eval.h
fileobject.h bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
fileutils.h bpo-37834: Normalise handling of reparse points on Windows (GH-15370) 2019-08-21 15:52:42 -07:00
floatobject.h
frameobject.h bpo-35134: Split traceback.h header (GH-13430) 2019-05-20 00:14:57 +02:00
funcobject.h bpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653) 2019-05-30 15:11:22 +02:00
genobject.h bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (GH-7468) (#16486) 2019-09-29 23:19:02 -07:00
graminit.h
grammar.h fix warnings by adding more const (GH-12924) 2019-04-23 20:39:37 +09:00
import.h bpo-36900: import.c uses PyInterpreterState.core_config (GH-13278) 2019-05-13 17:12:45 +02:00
interpreteridobject.h bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (gh-12359) 2019-03-15 16:35:46 -06:00
intrcheck.h bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980) 2019-05-28 17:16:33 +02:00
iterobject.h
listobject.h
longintrepr.h
longobject.h bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980) 2019-05-28 17:16:33 +02:00
marshal.h
memoryobject.h
methodobject.h [3.8] bpo-36974: separate vectorcall functions for each calling convention (GH-13781) (#14782) 2019-07-23 12:39:51 +02:00
modsupport.h [3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599) 2019-08-29 18:29:59 +03:00
moduleobject.h bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980) 2019-05-28 17:16:33 +02:00
namespaceobject.h
node.h
object.h Remove extraneous ')' in abstract.h (GH-19146) (#19451) 2020-04-09 14:55:00 -04:00
objimpl.h bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661) 2019-03-27 12:52:18 +01:00
odictobject.h
opcode.h
osdefs.h
osmodule.h
parsetok.h bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086) 2019-03-07 12:38:08 -08:00
patchlevel.h Post 3.8.3 2020-05-13 23:42:31 +02:00
picklebufobject.h bpo-36785: PEP 574 implementation (GH-7076) 2019-05-26 17:10:09 +02:00
py_curses.h
pyarena.h
pycapsule.h Merged revisions 88517 via svnmerge from 2011-02-22 23:43:57 +00:00
pyctype.h
pydebug.h
pydtrace.d bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
pydtrace.h bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
pyerrors.h [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15491) 2019-08-26 00:41:47 +10:00
pyexpat.h
pyfpe.h
pyhash.h Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 13:42:54 -07:00
pylifecycle.h bpo-36763: Make Py_BytesMain() public (GH-15532) 2019-08-26 16:17:56 -07:00
pymacconfig.h
pymacro.h bpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290) (GH-16306) 2019-09-20 23:36:32 +02:00
pymath.h
pymem.h bpo-35134: Add Include/cpython/pymem.h (GH-12840) 2019-04-15 17:00:19 +02:00
pyport.h closes bpo-38253: Fix typo of Py_SET_ERANGE_IF_OVERFLOW in pyport.h. (GH-16230) 2019-09-23 19:41:06 -07:00
pystate.h bpo-36124: Add PyInterpreterState.dict. (gh-12132) 2019-03-15 17:47:43 -06:00
pystrcmp.h
pystrhex.h bpo-22385: Support output separators in hex methods. (#13578) 2019-05-29 11:46:58 -07:00
pystrtod.h
pythonrun.h bpo-37189: Export old PyRun_XXX() functions (GH-14142) 2019-06-17 15:42:30 -07:00
pythread.h bpo-37077: Add native thread ID (TID) for AIX (GH-13624) 2019-06-13 15:54:04 -07:00
pytime.h Fix _PyTime_MIN/MAX values (GH-15384) (GH-15426) 2019-08-23 17:17:52 +01:00
rangeobject.h
setobject.h
sliceobject.h bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980) 2019-05-28 17:16:33 +02:00
structmember.h
structseq.h
symtable.h [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15491) 2019-08-26 00:41:47 +10:00
sysmodule.h bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
token.h bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086) 2019-03-07 12:38:08 -08:00
traceback.h bpo-35134: Split traceback.h header (GH-13430) 2019-05-20 00:14:57 +02:00
tracemalloc.h
tupleobject.h
typeslots.h
ucnhash.h
unicodeobject.h bpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623) 2019-10-07 21:12:05 +02:00
warnings.h
weakrefobject.h