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
c6b677c3
Commit
c6b677c3
authored
Jan 18, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn't
write complete output on close.
parent
f6965c12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
Lib/tarfile.py
Lib/tarfile.py
+1
-1
Lib/test/test_tarfile.py
Lib/test/test_tarfile.py
+6
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/tarfile.py
View file @
c6b677c3
...
...
@@ -1642,7 +1642,7 @@ class TarFile(object):
if not extfileobj and fileobj is not None:
fileobj.close()
raise
t._extfileobj =
extfileobj
t._extfileobj =
False
return t
@classmethod
...
...
Lib/test/test_tarfile.py
View file @
c6b677c3
...
...
@@ -855,6 +855,12 @@ class WriteTestBase(TarTest):
tar
.
addfile
(
tarfile
.
TarInfo
(
"foo"
))
tar
.
close
()
self
.
assertFalse
(
fobj
.
closed
,
"external fileobjs must never closed"
)
# Issue #20238: Incomplete gzip output with mode="w:gz"
data
=
fobj
.
getvalue
()
del
tar
support
.
gc_collect
()
self
.
assertFalse
(
fobj
.
closed
)
self
.
assertEqual
(
data
,
fobj
.
getvalue
())
class
WriteTest
(
WriteTestBase
,
unittest
.
TestCase
):
...
...
Misc/NEWS
View file @
c6b677c3
...
...
@@ -43,6 +43,9 @@ Core and Builtins
Library
-------
- Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn'
t
write
complete
output
on
close
.
-
Issue
#
20245
:
The
open
functions
in
the
tarfile
module
now
correctly
handle
empty
mode
.
...
...
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