summaryrefslogtreecommitdiff
path: root/Include/internal/pycore_pystate.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-02 14:56:30 -0400
committerGitHub <noreply@github.com>2019-05-02 14:56:30 -0400
commit709d23dee69e700b87d5a4cb59e149d0e1af7993 (patch)
treeb06aafe79f83137a3c85649bcebf1fbfd2ea1240 /Include/internal/pycore_pystate.h
parent6ae2bbbdfcb8969d1d362b17c2fbd5a684fa4f9d (diff)
downloadcpython-git-709d23dee69e700b87d5a4cb59e149d0e1af7993.tar.gz
bpo-36775: _PyCoreConfig only uses wchar_t* (GH-13062)
_PyCoreConfig: Change filesystem_encoding, filesystem_errors, stdio_encoding and stdio_errors fields type from char* to wchar_t*. Changes: * PyInterpreterState: replace fscodec_initialized (int) with fs_codec structure. * Add get_error_handler_wide() and unicode_encode_utf8() helper functions. * Add error_handler parameter to unicode_encode_locale() and unicode_decode_locale(). * Remove _PyCoreConfig_SetString(). * Rename _PyCoreConfig_SetWideString() to _PyCoreConfig_SetString(). * Rename _PyCoreConfig_SetWideStringFromString() to _PyCoreConfig_DecodeLocale().
Diffstat (limited to 'Include/internal/pycore_pystate.h')
-rw-r--r--Include/internal/pycore_pystate.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 2c24f679dc..67bcd147e2 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -56,7 +56,14 @@ struct _is {
PyObject *codec_search_cache;
PyObject *codec_error_registry;
int codecs_initialized;
- int fscodec_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) */
+ char *errors; /* Filesystem errors (encoded to UTF-8) */
+ _Py_error_handler error_handler;
+ } fs_codec;
_PyCoreConfig core_config;
#ifdef HAVE_DLOPEN