[issue13029] test_strptime fails on Windows 7 french

STINNER Victor report at bugs.python.org
Thu Sep 22 23:09:04 CEST 2011


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

Python 3 uses wcsftime() to format a timestamp and decodes tzname[0] and tzname[1] from UTF-8. The problem is that both methods format the quote differently: U+0092 for wcsftime("%Z") and U+2019 in tzname[1].


>>> time.strftime("%Z")
'Paris, Madrid (heure d\x92été)'

>>> time.tzname
('Paris, Madrid', 'Paris, Madrid (heure d\u2019été)')

======================================================================
ERROR: test_timezone (test.test_strptime.StrptimeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\victor\cpython\lib\test\test_strptime.py", line 303, in test_timezone

    strp_output = _strptime._strptime_time(strf_output, "%Z")
  File "C:\victor\cpython\lib\_strptime.py", line 482, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "C:\victor\cpython\lib\_strptime.py", line 340, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains:  (heure d\x92été)

======================================================================
FAIL: test_timezone (test.test_strptime.LocaleTime_Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\victor\cpython\lib\test\test_strptime.py", line 78, in test_timezone
    (timezone, self.LT_ins.timezone))
AssertionError: False is not true : timezone paris, madrid (heure d\x92été) not
found in (frozenset({'utc', 'paris, madrid', 'gmt'}), frozenset({'paris, madrid
(heure d\u2019été)'}))

----------------------------------------------------------------------

----------
components: Unicode, Windows
messages: 144417
nosy: haypo
priority: normal
severity: normal
status: open
title: test_strptime fails on Windows 7 french
versions: Python 3.3

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


More information about the Python-bugs-list mailing list