mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-40521: Add PyInterpreterState.unicode (GH-20081)
Move PyInterpreterState.fs_codec into a new PyInterpreterState.unicode structure. Give a name to the fs_codec structure and use this structure in unicodeobject.c.
This commit is contained in:
parent
75cd8e48c6
commit
3d17c045b4
3 changed files with 48 additions and 40 deletions
|
|
@ -51,6 +51,19 @@ struct _ceval_state {
|
|||
#endif
|
||||
};
|
||||
|
||||
/* fs_codec.encoding is initialized to NULL.
|
||||
Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */
|
||||
struct _Py_unicode_fs_codec {
|
||||
char *encoding; // Filesystem encoding (encoded to UTF-8)
|
||||
int utf8; // encoding=="utf-8"?
|
||||
char *errors; // Filesystem errors (encoded to UTF-8)
|
||||
_Py_error_handler error_handler;
|
||||
};
|
||||
|
||||
struct _Py_unicode_state {
|
||||
struct _Py_unicode_fs_codec fs_codec;
|
||||
};
|
||||
|
||||
|
||||
/* interpreter state */
|
||||
|
||||
|
|
@ -97,14 +110,7 @@ struct _is {
|
|||
PyObject *codec_error_registry;
|
||||
int codecs_initialized;
|
||||
|
||||
/* fs_codec.encoding is initialized to NULL.
|
||||
Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */
|
||||
struct {
|
||||
char *encoding; /* Filesystem encoding (encoded to UTF-8) */
|
||||
int utf8; /* encoding=="utf-8"? */
|
||||
char *errors; /* Filesystem errors (encoded to UTF-8) */
|
||||
_Py_error_handler error_handler;
|
||||
} fs_codec;
|
||||
struct _Py_unicode_state unicode;
|
||||
|
||||
PyConfig config;
|
||||
#ifdef HAVE_DLOPEN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue