Skip to content

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

Closed

Description

@serhiy-storchaka
$ 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>

Activity

  1. added a commit that references this issue on Apr 25, 2022
  2. added 2 commits that reference this issue on Apr 25, 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

    Labels

    3.10 (EOL)end of life3.11only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions