Skip to content

zipfile will fail if SOURCE_DATE_EPOCH is before 1980 #1605

Closed
@tuananh

Description

@tuananh

when SOURCE_DATE_EPOCH is set to a value before 1980, zipfile will fail with the following error

 2024/07/09 23:46:03 WARN     zip_info = zipfile.ZipInfo(relative_path, cast(TIME_TUPLE, self.time_tuple))
2024/07/09 23:46:03 WARN                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024/07/09 23:46:03 WARN   File "/usr/lib/python3.12/zipfile/__init__.py", line 398, in __init__
2024/07/09 23:46:03 WARN     raise ValueError('ZIP does not support timestamps before 1980')
2024/07/09 23:46:03 WARN ValueError: ZIP does not support timestamps before 1980

https://github.com/pypa/hatch/blob/3adae6c0dfd5c20dfe9bf6bae19b44a696c22a43/backend/src/hatchling/builders/utils.py#L86C1-L93C66

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions