When trying to build Python 3.6 (ignore the fact that it is severely outdated, I am an employee of a company maintaining it for enterprise customers) in GitHub I get a set of tests in test.test_tarfile
failing:
======================================================================
ERROR: setUpClass (test.test_tarfile.NoneInfoExtractTests_Data)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/cpython/cpython/Lib/test/test_tarfile.py", line 2790, in setUpClass
tar.extractall(cls.control_dir, filter=cls.extraction_filter)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2231, in extractall
tarinfo = self._get_extract_tarinfo(member, filter_function, path)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2283, in _get_extract_tarinfo
tarinfo = filter_function(tarinfo, path)
File "/__w/cpython/cpython/Lib/tarfile.py", line 831, in data_filter
new_attrs = _get_filtered_attrs(member, dest_path, True)
File "/__w/cpython/cpython/Lib/tarfile.py", line 778, in _get_filtered_attrs
target_path = os.path.realpath(os.path.join(dest_path, name))
File "/__w/cpython/cpython/Lib/posixpath.py", line 395, in realpath
path, ok = _joinrealpath(filename[:0], filename, {})
File "/__w/cpython/cpython/Lib/posixpath.py", line 429, in _joinrealpath
if not islink(newpath):
File "/__w/cpython/cpython/Lib/posixpath.py", line 171, in islink
st = os.lstat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 98-104: ordinal not in range(128)
======================================================================
ERROR: setUpClass (test.test_tarfile.NoneInfoExtractTests_Default)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/cpython/cpython/Lib/test/test_tarfile.py", line 2790, in setUpClass
tar.extractall(cls.control_dir, filter=cls.extraction_filter)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2240, in extractall
numeric_owner=numeric_owner)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2304, in _extract_one
numeric_owner=numeric_owner)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2384, in _extract_member
self.makefile(tarinfo, targetpath)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2429, in makefile
with bltn_open(targetpath, "wb") as target:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 98-104: ordinal not in range(128)
======================================================================
ERROR: setUpClass (test.test_tarfile.NoneInfoExtractTests_FullyTrusted)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/cpython/cpython/Lib/test/test_tarfile.py", line 2790, in setUpClass
tar.extractall(cls.control_dir, filter=cls.extraction_filter)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2240, in extractall
numeric_owner=numeric_owner)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2304, in _extract_one
numeric_owner=numeric_owner)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2384, in _extract_member
self.makefile(tarinfo, targetpath)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2429, in makefile
with bltn_open(targetpath, "wb") as target:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 98-104: ordinal not in range(128)
======================================================================
ERROR: setUpClass (test.test_tarfile.NoneInfoExtractTests_Tar)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/cpython/cpython/Lib/test/test_tarfile.py", line 2790, in setUpClass
tar.extractall(cls.control_dir, filter=cls.extraction_filter)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2231, in extractall
tarinfo = self._get_extract_tarinfo(member, filter_function, path)
File "/__w/cpython/cpython/Lib/tarfile.py", line 2283, in _get_extract_tarinfo
tarinfo = filter_function(tarinfo, path)
File "/__w/cpython/cpython/Lib/tarfile.py", line 825, in tar_filter
new_attrs = _get_filtered_attrs(member, dest_path, False)
File "/__w/cpython/cpython/Lib/tarfile.py", line 778, in _get_filtered_attrs
target_path = os.path.realpath(os.path.join(dest_path, name))
File "/__w/cpython/cpython/Lib/posixpath.py", line 395, in realpath
path, ok = _joinrealpath(filename[:0], filename, {})
File "/__w/cpython/cpython/Lib/posixpath.py", line 429, in _joinrealpath
if not islink(newpath):
File "/__w/cpython/cpython/Lib/posixpath.py", line 171, in islink
st = os.lstat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 98-104: ordinal not in range(128)
======================================================================
ERROR: test_data_filter (test.test_tarfile.TestExtractionFilters)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/cpython/cpython/Lib/test/test_tarfile.py", line 3438, in test_data_filter
filtered = tarfile.data_filter(tarinfo, '')
File "/__w/cpython/cpython/Lib/tarfile.py", line 831, in data_filter
new_attrs = _get_filtered_attrs(member, dest_path, True)
File "/__w/cpython/cpython/Lib/tarfile.py", line 778, in _get_filtered_attrs
target_path = os.path.realpath(os.path.join(dest_path, name))
File "/__w/cpython/cpython/Lib/posixpath.py", line 395, in realpath
path, ok = _joinrealpath(filename[:0], filename, {})
File "/__w/cpython/cpython/Lib/posixpath.py", line 429, in _joinrealpath
if not islink(newpath):
File "/__w/cpython/cpython/Lib/posixpath.py", line 171, in islink
st = os.lstat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 57-63: ordinal not in range(128)
======================================================================
ERROR: test_tar_filter (test.test_tarfile.TestExtractionFilters)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/__w/cpython/cpython/Lib/test/test_tarfile.py", line 3428, in test_tar_filter
filtered = tarfile.tar_filter(tarinfo, '')
File "/__w/cpython/cpython/Lib/tarfile.py", line 825, in tar_filter
new_attrs = _get_filtered_attrs(member, dest_path, False)
File "/__w/cpython/cpython/Lib/tarfile.py", line 778, in _get_filtered_attrs
target_path = os.path.realpath(os.path.join(dest_path, name))
File "/__w/cpython/cpython/Lib/posixpath.py", line 395, in realpath
path, ok = _joinrealpath(filename[:0], filename, {})
File "/__w/cpython/cpython/Lib/posixpath.py", line 429, in _joinrealpath
if not islink(newpath):
File "/__w/cpython/cpython/Lib/posixpath.py", line 171, in islink
st = os.lstat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 57-63: ordinal not in range(128)
Of course, I can easily avoid the problem by setting locale to en_US.utf8
or even C.utf8
, but my question is what are the expectation on the environment. Is this supposed to work or not? Should I make a patch?