summaryrefslogtreecommitdiffstats
path: root/Modules/_localemodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-03-08 06:24:44 (GMT)
committerGitHub <noreply@github.com>2017-03-08 06:24:44 (GMT)
commitad4a0cc519a5bb14204324e0e32e976318f9e6ce (patch)
tree2e07df2d2beaae9d84b48e5c9bf9a61de11009eb /Modules/_localemodule.c
parent02371e0ed1ee82ec73e7d363bcf2ed40cde1397a (diff)
downloadcpython-ad4a0cc519a5bb14204324e0e32e976318f9e6ce.zip
cpython-ad4a0cc519a5bb14204324e0e32e976318f9e6ce.tar.gz
cpython-ad4a0cc519a5bb14204324e0e32e976318f9e6ce.tar.bz2
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.
Diffstat (limited to 'Modules/_localemodule.c')
-rw-r--r--Modules/_localemodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index f5c126a..ecd673e 100644
--- a/Modules/_localemodule.c
+++ b/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;
}