]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back to limited API...
authorMiss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 10 Oct 2020 14:28:49 +0000 (07:28 -0700)
committerGitHub <noreply@github.com>
Sat, 10 Oct 2020 14:28:49 +0000 (07:28 -0700)
(cherry picked from commit 637a09b0d6e3ad4e34e0b5e0fc82f5afeae6f74b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Include/cpython/fileobject.h
Include/fileobject.h
Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst [new file with mode: 0644]

index 57eac13c064c2e8905bd8c1d57c93405b7c00842..3005ce1f00f9d5b7644fde56fb064ade7abbff5f 100644 (file)
@@ -8,14 +8,6 @@ extern "C" {
 
 PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
 
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
-PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
-#endif
-
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
-PyAPI_DATA(int) Py_UTF8Mode;
-#endif
-
 /* The std printer acts as a preliminary sys.stderr until the new io
    infrastructure is in place. */
 PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
index 456887ef9d045da0e5fa3147554164cd01a70522..6ec2994aa859b6fbcd71d12fd283733ea1d049ab 100644 (file)
@@ -20,8 +20,15 @@ PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
    If non-NULL, this is different than the default encoding for strings
 */
 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
+PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
+#endif
 PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
 
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
+PyAPI_DATA(int) Py_UTF8Mode;
+#endif
+
 /* A routine to check if a file descriptor can be select()-ed. */
 #ifdef _MSC_VER
     /* On Windows, any socket fd can be select()-ed, no matter how high */
diff --git a/Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst b/Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst
new file mode 100644 (file)
index 0000000..d456ba6
--- /dev/null
@@ -0,0 +1,2 @@
+:c:data:`Py_FileSystemDefaultEncodeErrors` and :c:data:`Py_UTF8Mode` are
+available again in limited API.