[issue15954] No error checking after using of the wcsxfrm()

Serhiy Storchaka report at bugs.python.org
Thu Sep 20 16:53:09 CEST 2012


Serhiy Storchaka added the comment:

> No, I think the appropriate error is ValueError, at least if errno is EINVAL.

With what message?

> msvcrt gives EILSEQ or ERANGE, but never EINVAL. EILSEQ is returned if LCMapString failed, and ERANE if the output buffer is too small.

I don't see where ERANE can be returned. If the output buffer is too small then the required buffer size (not including terminating null-char) should be returned.

I see the same issue with wcscoll() in locale.strcoll().

An alternative solution is in case of an error to return the original string (in locale.strxfrm) and to compare strings without regard locale (in locale.strcoll).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15954>
_______________________________________


More information about the Python-bugs-list mailing list