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
d804f536
Commit
d804f536
authored
Jan 13, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported test for the open of non-existent tarfile.
parent
2e27ddd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Lib/test/test_tarfile.py
Lib/test/test_tarfile.py
+8
-0
No files found.
Lib/test/test_tarfile.py
View file @
d804f536
...
...
@@ -181,6 +181,14 @@ class CommonReadTest(ReadTest):
self
.
assertRaises
(
tarfile
.
ReadError
,
tarfile
.
open
,
tmpname
,
self
.
mode
)
self
.
assertRaises
(
tarfile
.
ReadError
,
tarfile
.
open
,
tmpname
)
def
test_non_existent_tarfile
(
self
):
# Test for issue11513: prevent non-existent gzipped tarfiles raising
# multiple exceptions.
exctype
=
OSError
if
'|'
in
self
.
mode
else
IOError
with
self
.
assertRaisesRegexp
(
exctype
,
"xxx"
)
as
ex
:
tarfile
.
open
(
"xxx"
,
self
.
mode
)
self
.
assertEqual
(
ex
.
exception
.
errno
,
errno
.
ENOENT
)
def
test_ignore_zeros
(
self
):
# Test TarFile's ignore_zeros option.
if
self
.
mode
.
endswith
(
":gz"
):
...
...
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