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
a36cde4c
Commit
a36cde4c
authored
Mar 13, 2007
by
Lars Gustäbel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quick fix for tests that fail on systems with an encoding other
than 'iso8859-1'.
parent
a47337fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
Lib/test/test_tarfile.py
Lib/test/test_tarfile.py
+7
-6
No files found.
Lib/test/test_tarfile.py
View file @
a36cde4c
# encoding: iso8859-1
5
# encoding: iso8859-1
import
sys
import
os
...
...
@@ -46,7 +46,7 @@ class ReadTest(unittest.TestCase):
mode
=
"r:"
def
setUp
(
self
):
self
.
tar
=
tarfile
.
open
(
self
.
tarname
,
mode
=
self
.
mode
)
self
.
tar
=
tarfile
.
open
(
self
.
tarname
,
mode
=
self
.
mode
,
encoding
=
"iso8859-1"
)
def
tearDown
(
self
):
self
.
tar
.
close
()
...
...
@@ -177,7 +177,7 @@ class MiscReadTest(ReadTest):
def
test_extract_hardlink
(
self
):
# Test hardlink extraction (e.g. bug #857297).
tar
=
tarfile
.
open
(
tarname
,
errorlevel
=
1
)
tar
=
tarfile
.
open
(
tarname
,
errorlevel
=
1
,
encoding
=
"iso8859-1"
)
tar
.
extract
(
"ustar/regtype"
,
TEMPDIR
)
try
:
...
...
@@ -216,7 +216,7 @@ class StreamReadTest(ReadTest):
self
.
assertRaises
(
tarfile
.
StreamError
,
f
.
read
)
def
test_compare_members
(
self
):
tar1
=
tarfile
.
open
(
tarname
)
tar1
=
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
tar2
=
self
.
tar
while
True
:
...
...
@@ -363,6 +363,7 @@ class MemberReadTest(ReadTest):
self
.
_test_member
(
tarinfo
,
size
=
7011
,
chksum
=
md5_regtype
)
def
test_find_pax_umlauts
(
self
):
self
.
tar
=
tarfile
.
open
(
self
.
tarname
,
mode
=
self
.
mode
,
encoding
=
"iso8859-1"
)
tarinfo
=
self
.
tar
.
getmember
(
"pax/umlauts-"
)
self
.
_test_member
(
tarinfo
,
size
=
7011
,
chksum
=
md5_regtype
)
...
...
@@ -414,7 +415,7 @@ class PaxReadTest(ReadTest):
subdir
=
"pax"
def
test_pax_globheaders
(
self
):
tar
=
tarfile
.
open
(
tarname
)
tar
=
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
tarinfo
=
tar
.
getmember
(
"pax/regtype1"
)
self
.
assertEqual
(
tarinfo
.
uname
,
"foo"
)
self
.
assertEqual
(
tarinfo
.
gname
,
"bar"
)
...
...
@@ -777,7 +778,7 @@ class AppendTest(unittest.TestCase):
tar
.
close
()
def
_create_testtar
(
self
,
mode
=
"w:"
):
src
=
tarfile
.
open
(
tarname
)
src
=
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
t
=
src
.
getmember
(
"ustar/regtype"
)
t
.
name
=
"foo"
f
=
src
.
extractfile
(
t
)
...
...
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