[issue25742] locale.setlocale does not work with unicode strings

2015-11-29 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue25742] locale.setlocale does not work with unicode strings

2015-11-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset d7481ebeaa4f by Victor Stinner in branch '2.7': Issue #25742: Try to fix test_locale on Windows https://hg.python.org/cpython/rev/d7481ebeaa4f -- ___ Python tracker __

[issue25742] locale.setlocale does not work with unicode strings

2015-11-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: http://buildbot.python.org/all/builders/x86%20XP-4%202.7/builds/3517/steps/test/logs/stdio == ERROR: test_setlocale_unicode (test.test_locale.TestMiscellaneous)

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread STINNER Victor
STINNER Victor added the comment: Marc-Andre Lemburg added the comment: > No big deal. There are probably lots more places in the stdlib which > break without Unicode compiled in... :-) Well, to have more fun, try to run any Python application with a Python compiled without Unicode support *and*

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 28.11.2015 00:00, STINNER Victor wrote: > > STINNER Victor added the comment: > > Marc-Andre Lemburg added the comment: >> Hmm, but basestring is always defined, even when Python is compiled >> without Unicode support (...) > > Oh, I didn't know. Well,

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread STINNER Victor
STINNER Victor added the comment: Marc-Andre Lemburg added the comment: > Hmm, but basestring is always defined, even when Python is compiled > without Unicode support (...) Oh, I didn't know. Well, I already pushed my patch and it works. Feel free to modify locale.py to use basestring. I'm not

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7841e9b614eb by Victor Stinner in branch '2.7': Closes #25742: locale.setlocale() now accepts a Unicode string for its second https://hg.python.org/cpython/rev/7841e9b614eb -- nosy: +python-dev resolution: -> fixed stage: -> resolved statu

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 27.11.2015 23:50, STINNER Victor wrote: > > STINNER Victor added the comment: > >> BTW: Why did you use (_str, _unicode) instead of basestring ? > > Serhiy usually insists that technically, it's possible to compile Python 2.7 > without Unicode support.

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread STINNER Victor
STINNER Victor added the comment: > BTW: Why did you use (_str, _unicode) instead of basestring ? Serhiy usually insists that technically, it's possible to compile Python 2.7 without Unicode support. I don't believe that anyone uses this crazy feature, but well, it was easier to use _unicode (

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 27.11.2015 23:11, STINNER Victor wrote: > > STINNER Victor added the comment: > > I don't see the benefit of supporting Unicode strings for setlocale() > arguments: locale name are always encodable to ASCII, so loc.decode('ascii') > is enough to workar

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread STINNER Victor
STINNER Victor added the comment: I don't see the benefit of supporting Unicode strings for setlocale() arguments: locale name are always encodable to ASCII, so loc.decode('ascii') is enough to workaround the issue. But well, I think it's ok if it doesn't make the code much more complex ;-) I

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I wouldn't say this is a feature request. What the code wanted to check is "if this is an iterable of two strings, convert these to a locale string". I have no idea why the doc string uses "iterable". IMO, a tuple of two strings would have been fine and m

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: The doc for setlocale(category [,locale]) says "locale may be a string, or an iterable of two strings (language code and encoding)". The purpose of _build_locale is handle an iterable of two strings. This request looks like an enhancement request, which is n

[issue25742] locale.setlocale does not work with unicode strings

2015-11-27 Thread tierlieb
New submission from tierlieb: Within locale.py in setlocale your have this piece of code: if locale and type(locale) is not type(""): # convert to string locale = normalize(_build_localename(locale)) That does not work with unicode strings as I found out after wondering quit