Skip to content

Commit

Permalink
fix(script_mode): Use UTC timestamp for tar file attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Feb 24, 2025
1 parent e35bdd0 commit ddfae87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flytekit/tools/script_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import tarfile
import tempfile
import typing
from datetime import datetime
from datetime import datetime, timezone
from pathlib import Path
from types import ModuleType
from typing import List, Optional, Tuple, Union
Expand Down Expand Up @@ -73,7 +73,7 @@ def compress_scripts(source_path: str, destination: str, modules: List[ModuleTyp
def tar_strip_file_attributes(tar_info: tarfile.TarInfo) -> tarfile.TarInfo:
# set time to epoch timestamp 0, aka 00:00:00 UTC on 1 January 1980
# note that when extracting this tarfile, this time will be shown as the modified date
tar_info.mtime = datetime(1980, 1, 1).timestamp()
tar_info.mtime = datetime(1980, 1, 1, tzinfo=timezone.utc).timestamp()

# user/group info
tar_info.uid = 0
Expand Down

0 comments on commit ddfae87

Please sign in to comment.