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_gdb fails with LC_ALL=C #78718

Closed
vstinner opened this issue Aug 28, 2018 · 5 comments
Closed

test_gdb fails with LC_ALL=C #78718

vstinner opened this issue Aug 28, 2018 · 5 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir topic-unicode

Comments

@vstinner
Copy link
Member

BPO 34537
Nosy @vstinner, @ezio-melotti, @miss-islington
PRs
  • bpo-34537: Fix test_gdb:test_strings with LC_ALL=C #9483
  • [3.7] bpo-34537: Fix test_gdb:test_strings with LC_ALL=C (GH-9483) #9485
  • 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 2018-09-24.15:07:02.915>
    created_at = <Date 2018-08-28.20:05:29.396>
    labels = ['3.8', '3.7', 'tests', 'expert-unicode']
    title = 'test_gdb fails with LC_ALL=C'
    updated_at = <Date 2018-09-24.15:07:02.914>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2018-09-24.15:07:02.914>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-09-24.15:07:02.915>
    closer = 'vstinner'
    components = ['Tests', 'Unicode']
    creation = <Date 2018-08-28.20:05:29.396>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34537
    keywords = ['patch']
    message_count = 5.0
    messages = ['324284', '326059', '326060', '326062', '326080']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'ezio.melotti', 'miss-islington']
    pr_nums = ['9483', '9485']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34537'
    versions = ['Python 3.7', 'Python 3.8']

    @vstinner
    Copy link
    Member Author

    On Python 3.7 and master, test_strings() of test_gdb fails if gdb uses Python 3.6 (before UTF-8 Mode and C locale coercion):

    • gdb uses ASCII encoding for stdout
    • tested Python uses UTF-8 thanks to the UTF-8 Mode and/or C locale coercion

    vstinner@apu$ LC_ALL=C ./python -m test -v test_gdb -m test_strings
    == CPython 3.7.0+ (heads/3.7:65ef7425a3, Aug 28 2018, 16:29:30) [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)]
    == Linux-4.17.6-200.fc28.x86_64-x86_64-with-fedora-28-Twenty_Eight little-endian
    == cwd: /home/vstinner/prog/python/3.7/build/test_python_21689
    == CPU count: 8
    == encodings: locale=UTF-8, FS=utf-8
    Run tests sequentially
    0:00:00 load avg: 0.35 [1/1] test_gdb
    GDB version 8.1:
    GNU gdb (GDB) Fedora 8.1.1-3.fc28
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html\>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-redhat-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/\>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/\>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    test_strings (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of unicode strings ... FAIL

    ======================================================================
    FAIL: test_strings (test.test_gdb.PrettyPrintTests)
    Verify the pretty-printing of unicode strings
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/vstinner/prog/python/3.7/Lib/test/test_gdb.py", line 331, in test_strings
        check_repr('\u2620')
      File "/home/vstinner/prog/python/3.7/Lib/test/test_gdb.py", line 323, in check_repr
        self.assertGdbRepr(text)
      File "/home/vstinner/prog/python/3.7/Lib/test/test_gdb.py", line 271, in assertGdbRepr
        % (gdb_repr, exp_repr, gdb_output)))
    AssertionError: "'\\u2620'" != "'☠'"
    - '\u2620'
    + '☠'
     : "'\\u2620'" did not equal expected "'☠'"; full output was:
    Breakpoint 1 at 0x52fc1b: file Python/bltinmodule.c, line 1216.
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".

    Breakpoint 1, builtin_id (self=, v='\u2620') at Python/bltinmodule.c:1216
    1216 return PyLong_FromVoidPtr(v);
    #0 builtin_id (self=, v='\u2620') at Python/bltinmodule.c:1216

    ----------------------------------------------------------------------
    Ran 1 test in 1.030s

    FAILED (failures=1)
    test test_gdb failed
    test_gdb failed

    == Tests result: FAILURE ==

    1 test failed:
    test_gdb

    Total duration: 1 sec 422 ms
    Tests result: FAILURE

    @vstinner vstinner added 3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir topic-unicode labels Aug 28, 2018
    @vstinner
    Copy link
    Member Author

    New changeset 7279b51 by Victor Stinner (Elvis Pranskevichus) in branch 'master':
    bpo-34537: Fix test_gdb:test_strings with LC_ALL=C (GH-9483)
    7279b51

    @vstinner
    Copy link
    Member Author

    I don't think that it's worth it to backport the change to Python 3.6 and older, since "LC_ALL=C ./python -m test test_gdb" already pass on 2.7 and 3.6.

    @miss-islington
    Copy link
    Contributor

    New changeset e5fde1f by Miss Islington (bot) in branch '3.7':
    bpo-34537: Fix test_gdb:test_strings with LC_ALL=C (GH-9483)
    e5fde1f

    @vstinner
    Copy link
    Member Author

    Thank you Elvis for the fix!

    @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 3.8 only security fixes tests Tests in the Lib/test dir topic-unicode
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants