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

Skip to content

Commit ff6870f

Browse files
bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back to limited API (GH-22621)
(cherry picked from commit 637a09b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent ae485f5 commit ff6870f

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
@@ -8,14 +8,6 @@ extern "C" {
88

99
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
1010

11-
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
12-
PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
13-
#endif
14-
15-
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
16-
PyAPI_DATA(int) Py_UTF8Mode;
17-
#endif
18-
1911
/* The std printer acts as a preliminary sys.stderr until the new io
2012
infrastructure is in place. */
2113
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