Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_strptime and test_time fail on non-English Windows #75730

Closed
serhiy-storchaka opened this issue Sep 21, 2017 · 2 comments
Closed

test_strptime and test_time fail on non-English Windows #75730

serhiy-storchaka opened this issue Sep 21, 2017 · 2 comments
Labels
3.7 (EOL) end of life OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 31549
Nosy @pfmoore, @tjguk, @zware, @serhiy-storchaka, @zooba
Superseder
  • bpo-16322: time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding
  • 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 2017-09-25.08:01:52.536>
    created_at = <Date 2017-09-21.21:53:10.992>
    labels = ['3.7', 'type-bug', 'library', 'OS-windows']
    title = 'test_strptime and test_time fail on non-English Windows'
    updated_at = <Date 2017-09-25.08:01:52.534>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-09-25.08:01:52.534>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-09-25.08:01:52.536>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2017-09-21.21:53:10.992>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31549
    keywords = []
    message_count = 2.0
    messages = ['302732', '302917']
    nosy_count = 5.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'serhiy.storchaka', 'steve.dower']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '16322'
    type = 'behavior'
    url = 'https://bugs.python.org/issue31549'
    versions = ['Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    test_strptime and test_time fail on non-English Windows.

    For example:

    ======================================================================
    FAIL: test_localtime_timezone (test.test_time.TestPytime)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "C:\Users\Serhiy Storchaka\py\cpython\lib\test\test_time.py", line 643, in test_localtime_timezone
        self.assertEqual(lt.tm_zone, time.tzname[lt.tm_isdst])
    AssertionError: 'O?ieyia?y (e?oi)' != '\xd4\xb3\xed\xeb\xff\xed\xe4\xb3\xff (\xeb\xb3\xf2\xee)'
    - O?ieyia?y (e?oi)
    + \xd4\xb3\xed\xeb\xff\xed\xe4\xb3\xff (\xeb\xb3\xf2\xee)

    Seems there are problems with wrong encodings and lossy encoding on Windows.

    >>> '\xd4\xb3\xed\xeb\xff\xed\xe4\xb3\xff (\xeb\xb3\xf2\xee)'
    'Ô³íëÿíä³ÿ (ë³òî)'

    Looks similar to the string 'O?ieyia?y (e?oi)', isn't?

    >>> 'ô³íëÿíä³ÿ (çèìà)'.encode('latin1').decode('cp1251')
    'фінляндія (зима)'

    Actually it is a string 'фінляндія (зима)' ('Finland (Summer)' in Ukrainian) encoded with cp1251 (Cyrillic ANSI encoding) and misinterpreted as encoded with Latin1.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life stdlib Python modules in the Lib dir OS-windows type-bug An unexpected behavior, bug, or error labels Sep 21, 2017
    @serhiy-storchaka
    Copy link
    Member Author

    This looks a duplicate of bpo-16322.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant