diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-12-03 13:11:57 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-12-03 13:11:57 (GMT) |
commit | 41a234a6791dc3db1a918e0344a55a4e48c211a3 (patch) | |
tree | 310cf4a3c4a9811889c76e1c30dd7bc04db84928 /Python | |
parent | 27b1ca29ccf523e736a47c02f554de5374e241fc (diff) | |
download | cpython-41a234a6791dc3db1a918e0344a55a4e48c211a3.zip cpython-41a234a6791dc3db1a918e0344a55a4e48c211a3.tar.gz cpython-41a234a6791dc3db1a918e0344a55a4e48c211a3.tar.bz2 |
Issue #16416: Fix compilation error
Diffstat (limited to 'Python')
-rw-r--r-- | Python/fileutils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c index cba6696..94ab8e4 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -169,7 +169,9 @@ _Py_wchar2char(const wchar_t *text, size_t *error_pos) if (unicode == NULL) return NULL; - bytes = _PyUnicode_AsUTF8String(unicode, "surrogateescape"); + bytes = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), + PyUnicode_GET_SIZE(unicode), + "surrogateescape"); Py_DECREF(unicode); if (bytes == NULL) { PyErr_Clear(); |