Skip to content

Commit 91b69b7

Browse files
authored
bpo-43868: Remove PyOS_ReadlineFunctionPointer from the stable ABI list (pythonGH-25442)
The inclusion of PyOS_ReadlineFunctionPointer in python3dll.c was a mistake. According to PEP 384: > functions expecting FILE* are not part of the ABI, to avoid depending > on a specific version of the Microsoft C runtime DLL on Windows. https://bugs.python.org/issue43868
1 parent dcf6581 commit 91b69b7

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

Doc/whatsnew/3.10.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,12 @@ Removed
17401740
Use Python :mod:`symtable` module instead.
17411741
(Contributed by Victor Stinner in :issue:`43244`.)
17421742
1743+
* Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers
1744+
and from ``python3.dll``, the library that provides the stable ABI on
1745+
Windows. Since the function takes a ``FILE*`` argument, its ABI stability
1746+
cannot be guaranteed.
1747+
(Contributed by Petr Viktorin in :issue:`43868`.)
1748+
17431749
* Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files.
17441750
These functions were undocumented and excluded from the limited C API.
17451751
Most names defined by these header files were not prefixed by ``Py`` and so

Include/cpython/pythonrun.h

+1
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,4 @@ PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject
118118
/* Stuff with no proper home (yet) */
119119
PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
120120
PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
121+
PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);

Include/pythonrun.h

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
1616

1717
/* Stuff with no proper home (yet) */
1818
PyAPI_DATA(int) (*PyOS_InputHook)(void);
19-
PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
2019

2120
/* Stack size, in "pointers" (so we get extra safety margins
2221
on 64-bit platforms). On a 32-bit platform, this translates
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:c:func:`PyOS_ReadlineFunctionPointer` is no longer exported by limited C API
2+
headers and by ``python3.dll`` on Windows. Like any function that takes
3+
``FILE*``, it is not part of the stable ABI.

PC/python3dll.c

-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,6 @@ EXPORT_DATA(PyODictIter_Type)
808808
EXPORT_DATA(PyODictKeys_Type)
809809
EXPORT_DATA(PyODictValues_Type)
810810
EXPORT_DATA(PyOS_InputHook)
811-
EXPORT_DATA(PyOS_ReadlineFunctionPointer)
812811
EXPORT_DATA(PyProperty_Type)
813812
EXPORT_DATA(PyRange_Type)
814813
EXPORT_DATA(PyRangeIter_Type)

0 commit comments

Comments
 (0)