Skip to content

Several tests fail when system encoding is latin-1 #133677

Description

@StanFromIreland

This will only affect < 3.15 when PEP 686 is implemented, they pass: https://buildbot.python.org/?#/builders/1677/builds/2

Bug report

Bug description:

See buildbot run. (Note: some tests are failing due to the timezone, that is tracked in a separate issue)

$ locale charmap
ISO-8859-1
test_httpservers
test_undecodable_parameter (test.test_httpservers.SimpleHTTPServerTestCase.test_undecodable_parameter) ... ERROR
Stderr:
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 57558)
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/socketserver.py", line 318, in _handle_request_noblock
    self.process_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/socketserver.py", line 349, in process_request
    self.finish_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/http/server.py", line 721, in __init__
    super().__init__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/socketserver.py", line 766, in __init__
    self.handle()
    ~~~~~~~~~~~^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/http/server.py", line 485, in handle
    self.handle_one_request()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/http/server.py", line 473, in handle_one_request
    method()
    ~~~~~~^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/http/server.py", line 725, in do_GET
    f = self.send_head()
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/http/server.py", line 769, in send_head
    return self.list_directory(path)
           ~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/http/server.py", line 874, in list_directory
    encoded = '\n'.join(r).encode(enc, 'surrogateescape')
UnicodeEncodeError: 'latin-1' codec can't encode character '\ufffd' in position 181: ordinal not in range(256)
test_zipfile
test_cli_with_metadata_encoding_extract (test.test_zipfile.test_core.EncodedMetadataTests.test_cli_with_metadata_encoding_extract) ... Warning -- test_zipfile left behind file '@test_494020_tmpæ'
Warning -- files was modified by test_zipfile
Warning --   Before: []
Warning --   After:  ['@test_494020_tmpæ2/'] 
test test_zipfile crashed -- Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_zipfile/test_core.py", line 3641, in test_cli_with_metadata_encoding_extract
    os.stat(os.path.join(TESTFN2, fn))
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u4e00' in position 19: ordinal not in range(256)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 669, in run
    self._callTestMethod(testMethod)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_zipfile/test_core.py", line 3645, in test_cli_with_metadata_encoding_extract
    self.skipTest(f'cannot encode file name {fn!r}')
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 746, in skipTest
    raise SkipTest(reason)
unittest.case.SkipTest: cannot encode file name '\u4e00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 210, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 165, in _load_run_test
    regrtest_runner(result, test_func, runtests)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 118, in regrtest_runner
    test_result = test_func()
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 162, in test_func
    return run_unittest(test_mod, runtests)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 42, in run_unittest
    return _run_suite(tests)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 84, in _run_suite
    result = runner.run(suite)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/runner.py", line 257, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 725, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 668, in run
    with outcome.testPartExecutor(self):
         ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 63, in testPartExecutor
    _addSkip(self.result, test_case, str(e))
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 89, in _addSkip
    addSkip(test_case, reason)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/testresult.py", line 123, in addSkip
    super().addSkip(test, reason)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/runner.py", line 127, in addSkip
    self._write_status(test, f"{t.warn}skipped{t.reset} {reason!r}")
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/runner.py", line 76, in _write_status
    self.stream.writeln(status)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/runner.py", line 28, in writeln
    self.write(arg)
    ~~~~~~~~~~^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u4e00' in position 34: ordinal not in range(256)
test_asyncio
test_table_output_format (test.test_asyncio.test_tools.TestAsyncioToolsBasic.test_table_output_format) ... ok
Warning -- sys.stdout was modified by test.test_asyncio.test_tools
Warning --   Before: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='iso8859-1'>
Warning --   After:  <_io.StringIO object at 0x7f93ad20d0> 
Warning -- sys.stderr was modified by test.test_asyncio.test_tools
Warning --   Before: <_io.TextIOWrapper name='<stderr>' mode='w' encoding='iso8859-1'>
Warning --   After:  <_io.StringIO object at 0x7f93ad2fd0> 
test test.test_asyncio.test_tools crashed -- Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 210, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 165, in _load_run_test
    regrtest_runner(result, test_func, runtests)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 118, in regrtest_runner
    test_result = test_func()
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 162, in test_func
    return run_unittest(test_mod, runtests)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 42, in run_unittest
    return _run_suite(tests)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/single.py", line 84, in _run_suite
    result = runner.run(suite)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/runner.py", line 257, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/suite.py", line 122, in run
    test(result)
    ~~~~^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 725, in __call__
    return self.run(*args, **kwds)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/case.py", line 644, in run
    result.startTest(self)
    ~~~~~~~~~~~~~~~~^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/libregrtest/testresult.py", line 46, in startTest
    super().startTest(test)
    ~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/unittest/runner.py", line 62, in startTest
    self.stream.write(self.getDescription(test))
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in position 166: ordinal not in range(256)
test_argparse (presumably)

======================================================================
ERROR: test_directory (test.test_argparse.TestProgName.test_directory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6991, in test_directory
    self.check_usage(f'{py} {dirname}', dirname)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 21: invalid continuation byte

======================================================================
ERROR: test_directory_compiled (test.test_argparse.TestProgName.test_directory_compiled)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6996, in test_directory_compiled
    self.test_directory(compiled=True)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6991, in test_directory
    self.check_usage(f'{py} {dirname}', dirname)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 21: invalid continuation byte

======================================================================
ERROR: test_directory_in_zipfile (test.test_argparse.TestProgName.test_directory_in_zipfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7035, in test_directory_in_zipfile
    self.check_usage(f'{py} {dirname}', dirname)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 21: invalid continuation byte

======================================================================
ERROR: test_directory_in_zipfile_compiled (test.test_argparse.TestProgName.test_directory_in_zipfile_compiled)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7038, in test_directory_in_zipfile_compiled
    self.test_directory_in_zipfile(compiled=True)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7035, in test_directory_in_zipfile
    self.check_usage(f'{py} {dirname}', dirname)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 21: invalid continuation byte

======================================================================
ERROR: test_module (test.test_argparse.TestProgName.test_module)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7002, in test_module
    self.check_usage(f'{py} -m {modulename}',
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
                     '-m', modulename, PYTHONPATH=os.curdir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 24: invalid continuation byte

======================================================================
ERROR: test_module_compiled (test.test_argparse.TestProgName.test_module_compiled)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7006, in test_module_compiled
    self.test_module(compiled=True)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7002, in test_module
    self.check_usage(f'{py} -m {modulename}',
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
                     '-m', modulename, PYTHONPATH=os.curdir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 24: invalid continuation byte

======================================================================
ERROR: test_package (test.test_argparse.TestProgName.test_package)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7014, in test_package
    self.check_usage(f'{py} -m {packagename}',
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
                     '-m', packagename, PYTHONPATH=os.curdir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 24: invalid continuation byte

======================================================================
ERROR: test_package_compiled (test.test_argparse.TestProgName.test_package_compiled)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7020, in test_package_compiled
    self.test_package(compiled=True)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7014, in test_package
    self.check_usage(f'{py} -m {packagename}',
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
                     '-m', packagename, PYTHONPATH=os.curdir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 24: invalid continuation byte

======================================================================
ERROR: test_script (test.test_argparse.TestProgName.test_script)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6982, in test_script
    self.check_usage(os.path.basename(script_name), script_name, '-h')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 23: invalid continuation byte

======================================================================
ERROR: test_script_compiled (test.test_argparse.TestProgName.test_script_compiled)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6985, in test_script_compiled
    self.test_script(compiled=True)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6982, in test_script
    self.check_usage(os.path.basename(script_name), script_name, '-h')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 23: invalid continuation byte

======================================================================
ERROR: test_zipfile (test.test_argparse.TestProgName.test_zipfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7025, in test_zipfile
    self.check_usage(f'{py} {zip_name}', zip_name)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 21: invalid continuation byte

======================================================================
ERROR: test_zipfile_compiled (test.test_argparse.TestProgName.test_zipfile_compiled)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7028, in test_zipfile_compiled
    self.test_zipfile(compiled=True)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 7025, in test_zipfile
    self.check_usage(f'{py} {zip_name}', zip_name)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_argparse.py", line 6976, in check_usage
    self.assertEqual(res.out.splitlines()[0].decode(),
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 21: invalid continuation byte

----------------------------------------------------------------------
Ran 12 tests in 7.113s

FAILED (errors=12)
test test_argparse failed
test_pathlib (presumably)
0:52:44 load avg: 2.48 [ 8/10/8] test_pathlib failed (1 failure)
Re-running test_pathlib in verbose mode (matching: test_as_uri_windows)
test_as_uri_windows (test.test_pathlib.test_pathlib.PathSubclassTest.test_as_uri_windows) ... skipped 'requires Windows-flavoured path class'
test_as_uri_windows (test.test_pathlib.test_pathlib.PathTest.test_as_uri_windows) ... skipped 'requires Windows-flavoured path class'
test_as_uri_windows (test.test_pathlib.test_pathlib.PosixPathTest.test_as_uri_windows) ... skipped 'requires Windows-flavoured path class'
test_as_uri_windows (test.test_pathlib.test_pathlib.PurePathSubclassTest.test_as_uri_windows) ... skipped 'requires Windows-flavoured path class'
test_as_uri_windows (test.test_pathlib.test_pathlib.PurePathTest.test_as_uri_windows) ... skipped 'requires Windows-flavoured path class'
test_as_uri_windows (test.test_pathlib.test_pathlib.PurePosixPathTest.test_as_uri_windows) ... skipped 'requires Windows-flavoured path class'
test_as_uri_windows (test.test_pathlib.test_pathlib.PureWindowsPathTest.test_as_uri_windows) ... FAIL
test_as_uri_windows (test.test_pathlib.test_pathlib.WindowsPathTest.test_as_uri_windows) ... skipped 'test requires a Windows-compatible system'

======================================================================
FAIL: test_as_uri_windows (test.test_pathlib.test_pathlib.PureWindowsPathTest.test_as_uri_windows)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_pathlib/test_pathlib.py", line 773, in test_as_uri_windows
    self.assertEqual(self.make_uri(P('c:/a/b\xe9')), 'file:///c:/a/b%C3%A9')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'file:///c:/a/b%E9' != 'file:///c:/a/b%C3%A9'
- file:///c:/a/b%E9
?                ^
+ file:///c:/a/b%C3%A9
?                ^^^^


----------------------------------------------------------------------
Ran 8 tests in 0.046s

FAILED (failures=1, skipped=7)
test test_pathlib failed
test_urllib (possibly due to character in filename)
0:52:42 load avg: 2.44 [ 6/10/6] test_urllib failed (15 errors)
Re-running test_urllib in verbose mode (matching: test_close, test_fileno, test_getcode, test_geturl, test_headers, test_info, test_interface, test_iter, test_read, test_readline, test_readlines, test_relativelocalfile, test_remote_authority, test_status, test_url)
test_geturl (test.test_urllib.urlopen_DataTests.test_geturl) ... ok
test_info (test.test_urllib.urlopen_DataTests.test_info) ... ok
test_interface (test.test_urllib.urlopen_DataTests.test_interface) ... ok
test_close (test.test_urllib.urlopen_FileTests.test_close) ... ERROR
test_fileno (test.test_urllib.urlopen_FileTests.test_fileno) ... ERROR
test_getcode (test.test_urllib.urlopen_FileTests.test_getcode) ... ERROR
test_geturl (test.test_urllib.urlopen_FileTests.test_geturl) ... ERROR
test_headers (test.test_urllib.urlopen_FileTests.test_headers) ... ERROR
test_info (test.test_urllib.urlopen_FileTests.test_info) ... ERROR
test_interface (test.test_urllib.urlopen_FileTests.test_interface) ... ERROR
test_iter (test.test_urllib.urlopen_FileTests.test_iter) ... ERROR
test_read (test.test_urllib.urlopen_FileTests.test_read) ... ERROR
test_readline (test.test_urllib.urlopen_FileTests.test_readline) ... ERROR
test_readlines (test.test_urllib.urlopen_FileTests.test_readlines) ... ERROR
test_relativelocalfile (test.test_urllib.urlopen_FileTests.test_relativelocalfile) ... ERROR
test_remote_authority (test.test_urllib.urlopen_FileTests.test_remote_authority) ... ERROR
test_status (test.test_urllib.urlopen_FileTests.test_status) ... ERROR
test_url (test.test_urllib.urlopen_FileTests.test_url) ... ERROR

======================================================================
ERROR: test_close (test.test_urllib.urlopen_FileTests.test_close)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_fileno (test.test_urllib.urlopen_FileTests.test_fileno)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_getcode (test.test_urllib.urlopen_FileTests.test_getcode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_geturl (test.test_urllib.urlopen_FileTests.test_geturl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_headers (test.test_urllib.urlopen_FileTests.test_headers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_info (test.test_urllib.urlopen_FileTests.test_info)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_interface (test.test_urllib.urlopen_FileTests.test_interface)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_iter (test.test_urllib.urlopen_FileTests.test_iter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_read (test.test_urllib.urlopen_FileTests.test_read)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_readline (test.test_urllib.urlopen_FileTests.test_readline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_readlines (test.test_urllib.urlopen_FileTests.test_readlines)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_relativelocalfile (test.test_urllib.urlopen_FileTests.test_relativelocalfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_remote_authority (test.test_urllib.urlopen_FileTests.test_remote_authority)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_status (test.test_urllib.urlopen_FileTests.test_status)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

======================================================================
ERROR: test_url (test.test_urllib.urlopen_FileTests.test_url)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1471, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '@test_512880_tmpæ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/test/test_urllib.py", line 113, in setUp
    self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/home/stan/buildarea/3.x.stan-raspbian/build/Lib/urllib/request.py", line 1481, in open_local_file
    raise URLError(exp, exp.filename)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '@test_512880_tmpæ'>

----------------------------------------------------------------------
Ran 18 tests in 1.142s

FAILED (errors=15)
Warning -- test_urllib left behind file '@test_512880_tmpæ'
test test_urllib failed

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. sharktide commented on May 8, 2025

    @sharktide
    Contributor

    @StanFromIreland This is likely due to how cpython expects char and file encodings and ends up trying to decode/encode chars that don't exist in Latin 1

    TD;LR: Latin 1 can't encode characters such as U+4e00 which was mentioned in some error messages because there is no encoding for that unicode char in latin1! Latin 1 is 256 characters vs. Unicode ...

    This log output only proves it:

    UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in position 166: ordinal not in range(256)
    

    This should probably be documented in the devguide. I'd be happy do it.

  2. StanFromIreland commented on May 8, 2025

    @StanFromIreland
    MemberAuthor

    @sharktide

    I am well aware, and I have read the error messages.

    The problem is that tests should be skipped if they are not supported by the platform (or updated to do so).

  3. sharktide commented on May 8, 2025

    @sharktide
    Contributor

    @StanFromIreland This is also a valid solution

    I'll start working on a PR.

  4. sharktide commented on May 8, 2025

    @sharktide
    Contributor

    @StanFromIreland
    Considering that this issue might arise multiple times in the same test script, do you think that we should completely skip the tests and just add a warning for users on latin 1 rather than cherry-pick every possible cause of these, which wouldn't really help anyway?

    For test httpservers this might be okay, but for other ones like test_zipfile it might be extremely hard to pinpoint it. I'll work on a fix for that

  5. serhiy-storchaka commented on May 10, 2025

    @serhiy-storchaka
    Member

    Skipping tests is not always the best solution. First try to find the root cause of the error. It may be a bug in the test, and it may be a bug in the tested code.

  6. StanFromIreland commented on May 10, 2025

    @StanFromIreland
    MemberAuthor

    From my understanding test_httpservers was a test error so I opened the PR.

  7. sharktide commented on May 10, 2025

    @sharktide
    Contributor

    Same for test_zipfile and test_asyncio. I made PRs for those 2

  8. added 2 commits that reference this issue on May 11, 2025
  9. serhiy-storchaka commented on May 11, 2025

    @serhiy-storchaka
    Member

    There are more failing tests: test_fileio, test_sys, test_tarfile.

    test_httpservers, test_sys and test_tarfile are bugs in the stdlib and require separate PRs. #133865 fixes the rests of tests.

  10. 3 remaining items

  11. added a commit that references this issue on May 12, 2025
  12. added a commit that references this issue on May 12, 2025
  13. added 3 commits that reference this issue on May 12, 2025
  14. StanFromIreland commented on May 14, 2025

    @StanFromIreland
    MemberAuthor

    There are some fails specific to 3.14 see in test_venv, the pi symbol (π) is being decoded. This is because of the πthon link in the bin directory. What should we do with this one?

    cc @hauntsaninja who added it IIRC

  15. hauntsaninja commented on May 14, 2025

    @hauntsaninja
    Contributor

    We could catch the exception or filter out the suffix if we can't encode it. We can also just remove the easter egg on main. PEP 686 will make this all moot anyway!

  16. StanFromIreland commented on May 14, 2025

    @StanFromIreland
    MemberAuthor

    The Easter egg does not exist on main; was this a regression?

  17. hauntsaninja commented on May 14, 2025

    @hauntsaninja
    Contributor

    Code still exists on main for now, but the easter egg is version gated since it's 3.14 (pi) specific

  18. hugovk commented on May 15, 2025

    @hugovk
    Member

    We can also just remove the easter egg on main.

    #134037

  19. added a commit that references this issue on Jul 12, 2025
  20. added a commit that references this issue on Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.13only security fixes3.14bugs and security fixes3.15bugs and security fixestestsTests in the Lib/test dirtopic-unicodetype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions