Skip to content

Commit ad4a0cc

Browse files
authored
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.
1 parent 02371e0 commit ad4a0cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_localemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
262262
}
263263
errno = 0;
264264
n2 = wcsxfrm(buf, s, n1);
265-
if (errno) {
265+
if (errno && errno != ERANGE) {
266266
PyErr_SetFromErrno(PyExc_OSError);
267267
goto exit;
268268
}

0 commit comments

Comments
 (0)