8000 bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back … · python/cpython@637a09b · GitHub
[go: up one dir, main page]

Skip to content

Commit 637a09b

Browse files
bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back to limited API (GH-22621)
1 parent a427593 commit 637a09b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Include/cpython/fileobject.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44

55
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
66

7-
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
8-
PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
9-
#endif
10-
11-
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
12-
PyAPI_DATA(int) Py_UTF8Mode;
13-
#endif
14-
157
/* The std printer acts as a preliminary sys.stderr until the new io
168
infrastructure is in place. */
179
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);

Include/fileobject.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
2020
If non-NULL, this is different than the default encoding for strings
2121
*/
2222
PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
23+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
24+
PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
25+
#endif
2326
PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
2427

28+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
29+
PyAPI_DATA(int) Py_UTF8Mode;
30+
#endif
31+
2532
/* A routine to check if a file descriptor can be select()-ed. */
2633
#ifdef _MSC_VER
2734
/* On Windows, any socket fd can be select()-ed, no matter how high */
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:c:data:`Py_FileSystemDefaultEncodeErrors` and :c:data:`Py_UTF8Mode` are
2+
available again in limited API.

0 commit comments

Comments
 (0)
0