From: Victor Stinner Date: Mon, 3 Dec 2012 13:11:57 +0000 (+0100) Subject: Issue #16416: Fix compilation error X-Git-Tag: v3.2.4rc1~297 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41a234a6791dc3db1a918e0344a55a4e48c211a3;p=thirdparty%2FPython%2Fcpython.git Issue #16416: Fix compilation error --- diff --git a/Python/fileutils.c b/Python/fileutils.c index cba6696695c7..94ab8e42514d 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();