Kaydet (Commit) ad4a0cc5 authored tarafından Benjamin Peterson's avatar Benjamin Peterson Kaydeden (comit) GitHub

allow the first call to wcsxfrm to return ERANGE (#536)

If the output buffer provided to wcsxfrm is too small, errno is set to ERANGE. We should not error out in that case.
üst 02371e0e
...@@ -262,7 +262,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args) ...@@ -262,7 +262,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
} }
errno = 0; errno = 0;
n2 = wcsxfrm(buf, s, n1); n2 = wcsxfrm(buf, s, n1);
if (errno) { if (errno && errno != ERANGE) {
PyErr_SetFromErrno(PyExc_OSError); PyErr_SetFromErrno(PyExc_OSError);
goto exit; goto exit;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment