Skip to content

test_strptime fails on Windows 7 french #57238

Closed

Description

@vstinner
BPO 13029
Nosy @abalkin, @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2011-10-14.00:41:32.879>
created_at = <Date 2011-09-22.21:09:04.147>
labels = ['expert-unicode', 'OS-windows']
title = 'test_strptime fails on Windows 7 french'
updated_at = <Date 2011-10-14.00:41:32.879>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2011-10-14.00:41:32.879>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2011-10-14.00:41:32.879>
closer = 'vstinner'
components = ['Unicode', 'Windows']
creation = <Date 2011-09-22.21:09:04.147>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 13029
keywords = []
message_count = 4.0
messages = ['144417', '144418', '144420', '145491']
nosy_count = 3.0
nosy_names = ['belopolsky', 'vstinner', 'ocean-city']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue13029'
versions = ['Python 3.3']

Activity

  1. vstinner commented on Sep 22, 2011

    @vstinner
    MemberAuthor

    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é)'}))

  2. vstinner commented on Sep 22, 2011

    @vstinner
    MemberAuthor

    See also issue bpo-10653.

  3. abalkin commented on Sep 22, 2011

    @abalkin
    Member

    Isn't this a duplicate of bpo-10653? In any case, this looks like a windows only issue, so I cannot move it further. Would be interested in resolution, though. Thanks for making me nosy.

  4. vstinner commented on Oct 14, 2011

    @vstinner
    MemberAuthor

    Yes, this issue is a duplicate of bpo-10653.

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions