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_c_locale_coercion: test_PYTHONCOERCECLOCALE_set_to_one() failed on PPC64 Fedora 3.9 #85866

Closed
vstinner opened this issue Sep 3, 2020 · 7 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Sep 3, 2020

BPO 41700
Nosy @ncoghlan, @vstinner, @corona10, @miss-islington
PRs
  • bpo-41700: Skip test if the locale is not supported #22081
  • [3.9] bpo-41700: Skip test if the locale is not supported (GH-22081) #22085
  • [3.8] bpo-41700: Skip test if the locale is not supported (GH-22081) #22086
  • 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 2020-09-04.10:34:10.399>
    created_at = <Date 2020-09-03.09:40:09.751>
    labels = ['3.8', 'tests', '3.9', '3.10']
    title = 'test_c_locale_coercion: test_PYTHONCOERCECLOCALE_set_to_one() failed on PPC64 Fedora 3.9'
    updated_at = <Date 2020-09-04.10:34:18.940>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-09-04.10:34:18.940>
    actor = 'corona10'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-09-04.10:34:10.399>
    closer = 'corona10'
    components = ['Tests']
    creation = <Date 2020-09-03.09:40:09.751>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41700
    keywords = ['patch']
    message_count = 7.0
    messages = ['376290', '376291', '376320', '376339', '376346', '376347', '376352']
    nosy_count = 4.0
    nosy_names = ['ncoghlan', 'vstinner', 'corona10', 'miss-islington']
    pr_nums = ['22081', '22085', '22086']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41700'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 3, 2020

    https://buildbot.python.org/all/#/builders/34/builds/16

    pythoninfo:

    pre_config[utf8_mode]: 1
    os.environ[LANG]: C.UTF-8
    sys.filesystem_encoding: utf-8/surrogateescape
    sys.flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0, dev_mode=False, utf8_mode=1)

    Tests logs:

    0:23:06 load avg: 2.33 Re-running test_c_locale_coercion in verbose mode
    skipped 'No C-with-UTF-8 locale available'
    test_LC_ALL_set_to_C (test.test_c_locale_coercion.LocaleCoercionTests) ... ok
    test_PYTHONCOERCECLOCALE_not_set (test.test_c_locale_coercion.LocaleCoercionTests) ... ok
    test_PYTHONCOERCECLOCALE_not_zero (test.test_c_locale_coercion.LocaleCoercionTests) ... ok
    test_PYTHONCOERCECLOCALE_set_to_one (test.test_c_locale_coercion.LocaleCoercionTests) ... ERROR
    test_PYTHONCOERCECLOCALE_set_to_warn (test.test_c_locale_coercion.LocaleCoercionTests) ... ok
    test test_c_locale_coercion failed
    test_PYTHONCOERCECLOCALE_set_to_zero (test.test_c_locale_coercion.LocaleCoercionTests) ... ok

    ======================================================================
    ERROR: test_PYTHONCOERCECLOCALE_set_to_one (test.test_c_locale_coercion.LocaleCoercionTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shager/cpython-buildarea/3.9.edelsohn-fedora-ppc64/build/Lib/test/test_c_locale_coercion.py", line 410, in test_PYTHONCOERCECLOCALE_set_to_one
        loc = locale.setlocale(locale.LC_CTYPE, "")
      File "/home/shager/cpython-buildarea/3.9.edelsohn-fedora-ppc64/build/Lib/locale.py", line 610, in setlocale
        return _setlocale(category, locale)
    locale.Error: unsupported locale setting

    Ran 6 tests in 3.138s

    FAILED (errors=1, skipped=1)
    1 test failed again:
    test_c_locale_coercion

    I guess that the locale.setlocale(locale.LC_CTYPE, "") call should catch the locale.Error and skip the test if the locale is not supported.

    @vstinner vstinner added 3.9 only security fixes tests Tests in the Lib/test dir labels Sep 3, 2020
    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 3, 2020

    The test also fails on PPC64 Fedora 3.x:
    https://buildbot.python.org/all/#/builders/237/builds/40

    The test pass on PPC64 Fedora 3.8, the latest build still used "LANG=en_US.UTF-8":
    https://buildbot.python.org/all/#/builders/163/builds/12

    The test still passed on PPC64 Fedora 3.9 in build 15 which was using LANG=en_US.UTF-8:
    https://buildbot.python.org/all/#/builders/34/builds/15

    pythoninfo:

    pre_config[utf8_mode]: 0
    os.environ[LANG]: en_US.UTF-8
    sys.flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0, dev_mode=False, utf8_mode=0)
    sys.filesystem_encoding: utf-8/surrogateescape

    So the test started to fail when the buildbot worker configured changed to use LANG=C.UTF-8.

    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 3, 2020

    I can reproduce the issue with:

    $ LC_ALL=xxx ./python -m test test_c_locale_coercion -m test_PYTHONCOERCECLOCALE_set_to_one -v
    (...)

    ======================================================================
    ERROR: test_PYTHONCOERCECLOCALE_set_to_one (test.test_c_locale_coercion.LocaleCoercionTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/vstinner/python/master/Lib/test/test_c_locale_coercion.py", line 410, in test_PYTHONCOERCECLOCALE_set_to_one
        loc = locale.setlocale(locale.LC_CTYPE, "")
      File "/home/vstinner/python/master/Lib/locale.py", line 610, in setlocale
        return _setlocale(category, locale)
    locale.Error: unsupported locale setting
    (...)

    @corona10
    Copy link
    Member

    corona10 commented Sep 4, 2020

    New changeset 54a66ad by Dong-hee Na in branch 'master':
    bpo-41700: Skip test if the locale is not supported (GH-22081)
    54a66ad

    @corona10
    Copy link
    Member

    corona10 commented Sep 4, 2020

    New changeset 8f13ff9 by Miss Islington (bot) in branch '3.9':
    bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22085)
    8f13ff9

    @corona10
    Copy link
    Member

    corona10 commented Sep 4, 2020

    New changeset 4bcff52 by Miss Islington (bot) in branch '3.8':
    bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22086)
    4bcff52

    @corona10
    Copy link
    Member

    corona10 commented Sep 4, 2020

    This issue is fixed.
    Thanks for the report and review Victor!

    @corona10 corona10 closed this as completed Sep 4, 2020
    @corona10 corona10 closed this as completed Sep 4, 2020
    @corona10 corona10 added 3.8 only security fixes 3.10 only security fixes labels Sep 4, 2020
    @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.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants