diff options
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 4 |
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 |