Skip to content

Tests always fail on non-UTF-8 locale #91904

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

Closed
serhiy-storchaka opened this issue Apr 25, 2022 · 0 comments · Fixed by #91905
Closed

Tests always fail on non-UTF-8 locale #91904

serhiy-storchaka opened this issue Apr 25, 2022 · 0 comments · Fixed by #91905
Labels
3.10 only security fixes 3.11 only security fixes type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

$ LC_ALL=uk_UA.koi8u ./python -m test
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/serhiy/py/cpython/Lib/test/__main__.py", line 2, in <module>
    main()
    ^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 737, in main
    Regrtest().main(tests=tests, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/support/os_helper.py", line 396, in temp_dir
    yield path
    ^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/support/os_helper.py", line 427, in change_cwd
    yield os.getcwd()
    ^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/support/os_helper.py", line 449, in temp_cwd
    yield cwd_dir
    ^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 675, in main
    self._main(tests, kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/main.py", line 704, in _main
    setup_tests(self.ns)
    ^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/libregrtest/setup.py", line 107, in setup_tests
    os.environ.setdefault(
    ^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 717, in setdefault
  File "<frozen os>", line 683, in __setitem__
  File "<frozen os>", line 758, in encode
  File "/home/serhiy/py/cpython/Lib/encodings/koi8_u.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f60e' in position 0: character maps to <undefined>
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error 3.11 only security fixes 3.10 only security fixes labels Apr 25, 2022
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Apr 25, 2022
It always failed on non-UTF-8 locale and prevented running regrtests.
serhiy-storchaka added a commit that referenced this issue Apr 25, 2022
It always failed on non-UTF-8 locale and prevented running regrtests.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 25, 2022
…onGH-91905)

It always failed on non-UTF-8 locale and prevented running regrtests.
(cherry picked from commit 54d068a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this issue Apr 25, 2022
It always failed on non-UTF-8 locale and prevented running regrtests.
(cherry picked from commit 54d068a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes 3.11 only security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant