Browse Source

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.
pull/564/head
Benjamin Peterson 9 years ago
committed by GitHub
parent
commit
ad4a0cc519
  1. 2
      Modules/_localemodule.c

2
Modules/_localemodule.c

@ -262,7 +262,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
}
errno = 0;
n2 = wcsxfrm(buf, s, n1);
if (errno) {
if (errno && errno != ERANGE) {
PyErr_SetFromErrno(PyExc_OSError);
goto exit;
}

Loading…
Cancel
Save