| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6ae2bbb commit 709d23d
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,8 +207,8 @@ typedef struct { | |||
| 207 | 207 | ||
| 208 | 208 | See Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors. | |
| 209 | 209 | */ | |
| 210 | - char *filesystem_encoding; | ||
| 211 | - char *filesystem_errors; | ||
| 210 | + wchar_t *filesystem_encoding; | ||
| 211 | + wchar_t *filesystem_errors; | ||
| 212 | 212 | ||
| 213 | 213 | wchar_t *pycache_prefix; /* PYTHONPYCACHEPREFIX, -X pycache_prefix=PATH */ | |
| 214 | 214 | wchar_t *program_name; /* Program name, see also Py_GetProgramName() */ | |
@@ -334,13 +334,13 @@ typedef struct { | |||
| 334 | 334 | Value set from PYTHONIOENCODING environment variable and | |
| 335 | 335 | Py_SetStandardStreamEncoding() function. | |
| 336 | 336 | See also 'stdio_errors' attribute. */ | |
| 337 | - char *stdio_encoding; | ||
| 337 | + wchar_t *stdio_encoding; | ||
| 338 | 338 | ||
| 339 | 339 | /* Error handler of sys.stdin and sys.stdout. | |
| 340 | 340 | Value set from PYTHONIOENCODING environment variable and | |
| 341 | 341 | Py_SetStandardStreamEncoding() function. | |
| 342 | 342 | See also 'stdio_encoding' attribute. */ | |
| 343 | - char *stdio_errors; | ||
| 343 | + wchar_t *stdio_errors; | ||
| 344 | 344 | ||
| 345 | 345 | #ifdef MS_WINDOWS | |
| 346 | 346 | /* If greater than zero, use io.FileIO instead of WindowsConsoleIO for sys | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,12 +106,9 @@ PyAPI_FUNC(_PyInitError) _PyCoreConfig_Copy( | |||
| 106 | 106 | _PyCoreConfig *config, | |
| 107 | 107 | const _PyCoreConfig *config2); | |
| 108 | 108 | PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetString( | |
| 109 | - char **config_str, | ||
| 110 | - const char *str); | ||
| 111 | - PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetWideString( | ||
| 112 | 109 | wchar_t **config_str, | |
| 113 | 110 | const wchar_t *str); | |
| 114 | - PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetWideStringFromString( | ||
| 111 | + PyAPI_FUNC(_PyInitError) _PyCoreConfig_DecodeLocale( | ||
| 115 | 112 | wchar_t **config_str, | |
| 116 | 113 | const char *str); | |
| 117 | 114 | PyAPI_FUNC(_PyInitError) _PyCoreConfig_InitPathConfig(_PyCoreConfig *config); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,9 @@ extern int _Py_SetFileSystemEncoding( | |||
| 21 | 21 | const char *errors); | |
| 22 | 22 | extern void _Py_ClearFileSystemEncoding(void); | |
| 23 | 23 | extern _PyInitError _PyUnicode_InitEncodings(PyInterpreterState *interp); | |
| 24 | + #ifdef MS_WINDOWS | ||
| 25 | + extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void); | ||
| 26 | + #endif | ||
| 24 | 27 | ||
| 25 | 28 | PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void); | |
| 26 | 29 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,7 +56,14 @@ struct _is { | |||
| 56 | 56 | PyObject *codec_search_cache; | |
| 57 | 57 | PyObject *codec_error_registry; | |
| 58 | 58 | int codecs_initialized; | |
| 59 | - int fscodec_initialized; | ||
| 59 | + | ||
| 60 | + /* fs_codec.encoding is initialized to NULL. | ||
| 61 | + Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */ | ||
| 62 | + struct { | ||
| 63 | + char *encoding; /* Filesystem encoding (encoded to UTF-8) */ | ||
| 64 | + char *errors; /* Filesystem errors (encoded to UTF-8) */ | ||
| 65 | + _Py_error_handler error_handler; | ||
| 66 | + } fs_codec; | ||
| 60 | 67 | ||
| 61 | 68 | _PyCoreConfig core_config; | |
| 62 | 69 | #ifdef HAVE_DLOPEN | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -260,6 +260,7 @@ Py_LOCAL_INLINE(PyObject *) | |||
| 260 | 260 | STRINGLIB(utf8_encoder)(PyObject *unicode, | |
| 261 | 261 | STRINGLIB_CHAR *data, | |
| 262 | 262 | Py_ssize_t size, | |
| 263 | + _Py_error_handler error_handler, | ||
| 263 | 264 | const char *errors) | |
| 264 | 265 | { | |
| 265 | 266 | Py_ssize_t i; /* index into data of next input character */ | |
@@ -268,7 +269,6 @@ STRINGLIB(utf8_encoder)(PyObject *unicode, | |||
| 268 | 269 | PyObject *error_handler_obj = NULL; | |
| 269 | 270 | PyObject *exc = NULL; | |
| 270 | 271 | PyObject *rep = NULL; | |
| 271 | - _Py_error_handler error_handler = _Py_ERROR_UNKNOWN; | ||
| 272 | 272 | #endif | |
| 273 | 273 | #if STRINGLIB_SIZEOF_CHAR == 1 | |
| 274 | 274 | const Py_ssize_t max_char_size = 2; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments