summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-02 18:56:30 (GMT)
committerGitHub <noreply@github.com>2019-05-02 18:56:30 (GMT)
commit709d23dee69e700b87d5a4cb59e149d0e1af7993 (patch)
treeb06aafe79f83137a3c85649bcebf1fbfd2ea1240 /Objects/stringlib
parent6ae2bbbdfcb8969d1d362b17c2fbd5a684fa4f9d (diff)
downloadcpython-709d23dee69e700b87d5a4cb59e149d0e1af7993.zip
cpython-709d23dee69e700b87d5a4cb59e149d0e1af7993.tar.gz
cpython-709d23dee69e700b87d5a4cb59e149d0e1af7993.tar.bz2
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 'Objects/stringlib')
-rw-r--r--Objects/stringlib/codecs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index 0abb4c8..8645bc2 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -260,6 +260,7 @@ Py_LOCAL_INLINE(PyObject *)
STRINGLIB(utf8_encoder)(PyObject *unicode,
STRINGLIB_CHAR *data,
Py_ssize_t size,
+ _Py_error_handler error_handler,
const char *errors)
{
Py_ssize_t i; /* index into data of next input character */
@@ -268,7 +269,6 @@ STRINGLIB(utf8_encoder)(PyObject *unicode,
PyObject *error_handler_obj = NULL;
PyObject *exc = NULL;
PyObject *rep = NULL;
- _Py_error_handler error_handler = _Py_ERROR_UNKNOWN;
#endif
#if STRINGLIB_SIZEOF_CHAR == 1
const Py_ssize_t max_char_size = 2;