Author ezio.melotti
Recipients ezio.melotti, vincent.chute
Date 2009-02-20.03:08:07
SpamBayes Score 7.61445e-07
Marked as misclassified No
Message-id <1235099291.2.0.940947004682.issue3067@psf.upfronthosting.co.za>
In-reply-to
Content
FWIW the type("") is gone in Py3, now it is:
"if locale and not isinstance(locale, _builtin_str):"
where "from builtins import str as _builtin_str"
(http://svn.python.org/view/python/branches/py3k/Lib/locale.py?view=markup)

However Py3.0 now raises the same error when the second arg is a byte
string:
>>> locale.setlocale(locale.LC_ALL, b'ja_JP.utf8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Programs\Python30\lib\locale.py", line 500, in setlocale
    locale = normalize(_build_localename(locale))
  File "C:\Programs\Python30\lib\locale.py", line 408, in _build_localename
    language, encoding = localetuple
ValueError: too many values to unpack

On Py3, locale.setlocale() should allow only unicode strings and reject
byte strings.
History
Date User Action Args
2009-02-20 03:08:11ezio.melottisetrecipients: + ezio.melotti, vincent.chute
2009-02-20 03:08:11ezio.melottisetmessageid: <1235099291.2.0.940947004682.issue3067@psf.upfronthosting.co.za>
2009-02-20 03:08:09ezio.melottilinkissue3067 messages
2009-02-20 03:08:07ezio.melotticreate