Skip to content

Commit

Permalink
Restore datafile timestamps after unzipping
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Mar 4, 2024
1 parent 301d787 commit d5b4abe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions annif/cli_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import shutil
import sys
import tempfile
import time
import zipfile
from fnmatch import fnmatch
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -333,6 +334,8 @@ def unzip(src_path, force):
else:
logger.debug(f"Unzipping {member.filename}")
zfile.extract(member)
date_time = time.mktime(member.date_time + (0, 0, -1))
os.utime(member.filename, (date_time, date_time))


def move_project_config(src_path, force):
Expand Down

0 comments on commit d5b4abe

Please sign in to comment.