summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2015-05-27 12:53:44 +0200
committerLars Gustäbel <lars@gustaebel.de>2015-05-27 12:53:44 +0200
commit20703c696913dc8ec7d9b7153a10eda3cecce164 (patch)
tree8c52eeed160bf625816d617b60da69d8c4a51044 /Lib/tarfile.py
parentc30a6ce59d03cc506b1a6164c838d18f6526a004 (diff)
downloadcpython-git-20703c696913dc8ec7d9b7153a10eda3cecce164.tar.gz
tarfile.open() with mode 'x' created files without an end of archive marker.
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-xLib/tarfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 0f1c8253de..bf2234f637 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1484,7 +1484,7 @@ class TarFile(object):
except HeaderError as e:
raise ReadError(str(e))
- if self.mode in "aw":
+ if self.mode in ("a", "w", "x"):
self._loaded = True
if self.pax_headers:
@@ -1716,7 +1716,7 @@ class TarFile(object):
self.closed = True
try:
- if self.mode in "aw":
+ if self.mode in ("a", "w", "x"):
self.fileobj.write(NUL * (BLOCKSIZE * 2))
self.offset += (BLOCKSIZE * 2)
# fill up the end with zero-blocks