ZipFile and timestamps

Manfred Lotz ml_news at posteo.de
Wed Mar 18 16:38:45 EDT 2020


I unzip a zip file like follows which works fine.   

 with ZipFile(zip_file, 'r') as zip:
        zip.extractall(tmp_dir)

The only caveat is that the unpacked files and dirs do have a current
timestamp i.e. the timestamps of the files are not preserved.

Is there a way to tell ZipFile to preserve timestamps when unpacking a
zip archive?


-- 
Manfred



More information about the Python-list mailing list