Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
162c477f
Commit
162c477f
authored
Feb 19, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20672: Fixed tests for TarFile.list() on non-UTF-8 locales.
parent
e9597762
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
Lib/test/test_tarfile.py
Lib/test/test_tarfile.py
+10
-8
No files found.
Lib/test/test_tarfile.py
View file @
162c477f
...
...
@@ -238,14 +238,16 @@ class ListTest(ReadTest, unittest.TestCase):
self
.
assertIn
(
b'ustar/dirtype/'
,
out
)
self
.
assertIn
(
b'ustar/dirtype-with-size/'
,
out
)
# Make sure it is able to print unencodable characters
self
.
assertIn
(
br'ustar/umlauts-'
br'\udcc4\udcd6\udcdc\udce4\udcf6\udcfc\udcdf'
,
out
)
self
.
assertIn
(
br'misc/regtype-hpux-signed-chksum-'
br'\udcc4\udcd6\udcdc\udce4\udcf6\udcfc\udcdf'
,
out
)
self
.
assertIn
(
br'misc/regtype-old-v7-signed-chksum-'
br'\udcc4\udcd6\udcdc\udce4\udcf6\udcfc\udcdf'
,
out
)
self
.
assertIn
(
br'pax/bad-pax-\udce4\udcf6\udcfc'
,
out
)
self
.
assertIn
(
br'pax/hdrcharset-\udce4\udcf6\udcfc'
,
out
)
def
conv
(
b
):
s
=
b
.
decode
(
self
.
tar
.
encoding
,
'surrogateescape'
)
return
s
.
encode
(
'ascii'
,
'backslashreplace'
)
self
.
assertIn
(
conv
(
b'ustar/umlauts-
\
xc4
\
xd6
\
xdc
\
xe4
\
xf6
\
xfc
\
xdf
'
),
out
)
self
.
assertIn
(
conv
(
b'misc/regtype-hpux-signed-chksum-'
b'
\
xc4
\
xd6
\
xdc
\
xe4
\
xf6
\
xfc
\
xdf
'
),
out
)
self
.
assertIn
(
conv
(
b'misc/regtype-old-v7-signed-chksum-'
b'
\
xc4
\
xd6
\
xdc
\
xe4
\
xf6
\
xfc
\
xdf
'
),
out
)
self
.
assertIn
(
conv
(
b'pax/bad-pax-
\
xe4
\
xf6
\
xfc
'
),
out
)
self
.
assertIn
(
conv
(
b'pax/hdrcharset-
\
xe4
\
xf6
\
xfc
'
),
out
)
# Make sure it prints files separated by one newline without any
# 'ls -l'-like accessories if verbose flag is not being used
# ...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment