Skip to content

Commit 274dcbc

Browse files
committed
allow the first call to wcsxfrm to return ERANGE
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 8886d5f commit 274dcbc

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)