mirror of https://github.com/pypa/pip
parent
41cf790d7a
commit
227572f757
|
@ -562,12 +562,10 @@ def untar_file(filename, location):
|
|||
)
|
||||
continue
|
||||
ensure_dir(os.path.dirname(path))
|
||||
destfp = open(path, 'wb')
|
||||
try:
|
||||
with open(path, 'wb') as destfp:
|
||||
shutil.copyfileobj(fp, destfp)
|
||||
finally:
|
||||
destfp.close()
|
||||
fp.close()
|
||||
# Update the timestamp (useful for cython compiled files)
|
||||
tar.utime(member, path)
|
||||
# member have any execute permissions for user/group/world?
|
||||
if member.mode & 0o111:
|
||||
# make dest file have execute for user/group/world
|
||||
|
|
|
@ -327,6 +327,10 @@ class TestUnpackArchives(object):
|
|||
test_file = data.packages.join("test_tar.tgz")
|
||||
untar_file(test_file, self.tempdir)
|
||||
self.confirm_files()
|
||||
# Check the timestamp of an extracted file
|
||||
file_txt_path = os.path.join(self.tempdir, 'file.txt')
|
||||
mtime = time.gmtime(os.stat(file_txt_path).st_mtime)
|
||||
assert mtime[0:6] == (2013, 8, 16, 5, 13, 37), mtime
|
||||
|
||||
def test_unpack_zip(self, data):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue