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 <rep...@bugs.python.org>
<http://bugs.python.org/issue15954>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to