Skip to content

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

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

Open
StanFromIreland opened this issue May 8, 2025 · 4 comments
Open

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

StanFromIreland opened this issue May 8, 2025 · 4 comments
Labels
tests Tests in the Lib/test dir topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@StanFromIreland
Copy link
Contributor

StanFromIreland commented May 8, 2025

This will only affect < 3.15 when PEP 686 is implemented.

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

@StanFromIreland StanFromIreland added the type-bug An unexpected behavior, bug, or error label May 8, 2025
@sharktide
Copy link
Contributor

sharktide commented May 8, 2025

@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.

@StanFromIreland
Copy link
Contributor Author

StanFromIreland commented May 8, 2025

@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).

@sharktide
Copy link
Contributor

@StanFromIreland This is also a valid solution

I'll start working on a PR.

@sharktide
Copy link
Contributor

sharktide commented May 8, 2025

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-unicode type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants