Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(script_mode): Use UTC timestamp for tar file attributes #3154

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading