[issue5903] strftime fails in non UTF-8 locale

2009-05-29 Thread Martin v . Löwis
Martin v. Löwis added the comment: This is a duplicate of issue 3061. -- nosy: +loewis resolution: -> duplicate status: open -> closed superseder: -> time.strftime() always decodes result with UTF-8 ___ Python tracker

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, it turns out that strftime() is buggy as well: >>> tp = time.strptime("2009-12-01", "%Y-%m-%d") >>> locale.setlocale(locale.LC_TIME, "fr_FR.ISO8859-15") 'fr_FR.ISO8859-15' >>> time.strftime("%B", tp) Traceback (most recent call last): File "", line 1, i

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, sorry for the message above. There is a problem but it is with strptime() actually. >>> time.strptime("2009-12-01", "%Y-%m-%d") Traceback (most recent call last): File "", line 1, in File "/home/antoine/py3k/__svn__/Lib/_strptime.py", line 461, in _s

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- priority: -> high stage: -> test needed type: -> behavior versions: +Python 3.1 ___ Python tracker ___ __

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Same thing here (Linux) with a non-utf8 locale: >>> locale.setlocale(locale.LC_TIME, "fr_FR.UTF-8") 'fr_FR.UTF-8' >>> time.strftime("%B", time.strptime("2009-12-01", "%Y-%m-%d")) 'décembre' >>> locale.setlocale(locale.LC_TIME, "fr_FR.ISO8859-15") 'fr_FR.ISO8859

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Ezio Melotti
Ezio Melotti added the comment: I was able to reproduce this using an italian locale on Windows: >>> locale.setlocale(locale.LC_TIME, 'Italian_Italy.1252') 'Italian_Italy.1252' >>> time.strftime("%A", time.strptime("2009-05-01", "%Y-%m-%d")) 'venerd?' That should be 'venerdì'. I also found http

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Ezio Melotti
Ezio Melotti added the comment: Here the issue might be different though. Does $ LC_ALL=ru_RU.koi8-r python3.0 -c 'import time;time.strftime("%A")' (without the print) work? I don't have the ru_RU locale but here time.strftime() return 'str', not 'bytes' and the utf-8 codec should be able to e

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Ezio Melotti
Ezio Melotti added the comment: See http://bugs.python.org/issue5398 -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-lis

[issue5903] strftime fails in non UTF-8 locale

2009-05-02 Thread Barry Alan Scott
New submission from Barry Alan Scott : On Mac OS X 10.5 $ LC_ALL=ru_RU.koi8-r python3.0 -c 'import time;print( time.strftime("%A"))' Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: invalid data -- components: