Skip to content

Commit

Permalink
CVE-2007-4559 Remove invalid tests, get others working with Python2
Browse files Browse the repository at this point in the history
  • Loading branch information
rickprice committed Jan 7, 2025
1 parent 53576c4 commit 00cee64
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 107 deletions.
16 changes: 16 additions & 0 deletions Lib/tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,22 @@ def __iter__(self):
if not line:
break
yield line

def __enter__(self):
#INFO: This was used in Python3.6, but we aren't based off io.BufferedReader in Python2
# self._check()
return self

def __exit__(self, type, value, traceback):
if type is None:
self.close()
else:
# An exception occurred. We must not call close() because
# it would try to write end-of-archive blocks and padding.
#INFO: This was used in Python3.6, but we aren't based off io.BufferedReader in Python2
# if not self._extfileobj:
# self.fileobj.close()
self.close()
#class ExFileObject

#------------------
Expand Down
Loading

0 comments on commit 00cee64

Please sign in to comment.