]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43868: Remove PyOS_ReadlineFunctionPointer from the stable ABI list (GH-25442)
authorPetr Viktorin <encukou@gmail.com>
Fri, 23 Apr 2021 12:23:38 +0000 (14:23 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Apr 2021 12:23:38 +0000 (14:23 +0200)
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

Doc/whatsnew/3.10.rst
Include/cpython/pythonrun.h
Include/pythonrun.h
Misc/NEWS.d/next/C API/2021-04-16-18-15-56.bpo-43868.twQ7KH.rst [new file with mode: 0644]
PC/python3dll.c

index 1c2919a06c4d320a6209b46659ef43e17d4e012e..67e03f2f5efb0dbdcb9db52a307321012170f286 100644 (file)
@@ -1740,6 +1740,12 @@ Removed
   Use Python :mod:`symtable` module instead.
   (Contributed by Victor Stinner in :issue:`43244`.)
 
+* Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers
+  and from ``python3.dll``, the library that provides the stable ABI on
+  Windows. Since the function takes a ``FILE*`` argument, its ABI stability
+  cannot be guaranteed.
+  (Contributed by Petr Viktorin in :issue:`43868`.)
+
 * Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files.
   These functions were undocumented and excluded from the limited C API.
   Most names defined by these header files were not prefixed by ``Py`` and so
index ffca0e457d58b58f527dd44520e3541a388bf639..2e72d0820d34f549f89ab0116e53c30cf8cc5635 100644 (file)
@@ -118,3 +118,4 @@ PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject
 /* Stuff with no proper home (yet) */
 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
 PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
+PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
index b87bc738902420dc7924140df1573861eb0ccc15..b0a2fc3002d37d042d4fbb42e87ca7ef16a9dbb7 100644 (file)
@@ -16,7 +16,6 @@ PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
 
 /* Stuff with no proper home (yet) */
 PyAPI_DATA(int) (*PyOS_InputHook)(void);
-PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
 
 /* Stack size, in "pointers" (so we get extra safety margins
    on 64-bit platforms).  On a 32-bit platform, this translates
diff --git a/Misc/NEWS.d/next/C API/2021-04-16-18-15-56.bpo-43868.twQ7KH.rst b/Misc/NEWS.d/next/C API/2021-04-16-18-15-56.bpo-43868.twQ7KH.rst
new file mode 100644 (file)
index 0000000..50888b8
--- /dev/null
@@ -0,0 +1,3 @@
+:c:func:`PyOS_ReadlineFunctionPointer` is no longer exported by limited C API
+headers and by ``python3.dll`` on Windows. Like any function that takes
+``FILE*``, it is not part of the stable ABI.
index 195c6531fdf887416aea345f7f15eb5c46f67bdb..e5a21ed7c022e79011cd66c37bf697fa86dec790 100644 (file)
@@ -808,7 +808,6 @@ EXPORT_DATA(PyODictIter_Type)
 EXPORT_DATA(PyODictKeys_Type)
 EXPORT_DATA(PyODictValues_Type)
 EXPORT_DATA(PyOS_InputHook)
-EXPORT_DATA(PyOS_ReadlineFunctionPointer)
 EXPORT_DATA(PyProperty_Type)
 EXPORT_DATA(PyRange_Type)
 EXPORT_DATA(PyRangeIter_Type)