Skip to content

2.3.0 PyPi tarball mangling mtime on files #5770

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

Closed
TinfoilSubmarine opened this issue May 8, 2025 · 4 comments · Fixed by #5782
Closed

2.3.0 PyPi tarball mangling mtime on files #5770

TinfoilSubmarine opened this issue May 8, 2025 · 4 comments · Fixed by #5782
Assignees

Comments

@TinfoilSubmarine
Copy link

Problem

When trying to run the tests:

______________________________ RmTempTest.test_rm ______________________________

self = <test.test_importer.RmTempTest testMethod=test_rm>

    def test_rm(self):
>       zip_path = create_archive(self)

test/test_importer.py:259: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/test_importer.py:241: in create_archive
    archive.write(syspath(os.path.join(_common.RSRC, b"full.mp3")), "full.mp3")
/usr/lib/python3.13/zipfile/__init__.py:1889: in write
    zinfo = ZipInfo.from_file(filename, arcname,
/usr/lib/python3.13/zipfile/__init__.py:596: in from_file
    zinfo = cls(arcname, date_time)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError("'zipfile.ZipInfo' object has no attribute 'compress_type'") raised in repr()] ZipInfo object at 0x7f3b2c2717d0>
filename = 'full.mp3', date_time = (1970, 1, 1, 0, 0, 0)

    def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
        self.orig_filename = filename   # Original file name in archive
    
        # Terminate the file name at the first null byte and
        # ensure paths always use forward slashes as the directory separator.
        filename = _sanitize_filename(filename)
    
        self.filename = filename        # Normalized file name
        self.date_time = date_time      # year, month, day, hour, min, sec
    
        if date_time[0] < 1980:
>           raise ValueError('ZIP does not support timestamps before 1980')
E           ValueError: ZIP does not support timestamps before 1980

/usr/lib/python3.13/zipfile/__init__.py:412: ValueError

Looking at the file:

$ stat test/rsrc/full.mp3                                                                                                                                                                                          
  File: test/rsrc/full.mp3
  Size: 12820     	Blocks: 33         IO Block: 13312  regular file
Device: 0,30	Inode: 9091031     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/    joel)   Gid: ( 1000/    joel)
Access: 2025-05-08 08:58:23.524990591 -0400
Modify: 1969-12-31 19:00:00.000000000 -0500
Change: 2025-05-08 08:58:23.524990591 -0400
 Birth: 2025-05-08 08:58:23.524990591 -0400

Setup

  • OS: Void Linux
  • Python version: 3.13.3
  • beets version: 2.3.0
@nmeum
Copy link
Contributor

nmeum commented May 11, 2025

These also fail for us in Alpine, though we use the GitHub tarball as a source.

@snejus
Copy link
Member

snejus commented May 13, 2025

beets does not support Python 13 yet.

@nmeum
Copy link
Contributor

nmeum commented May 13, 2025

We have the same issue in Alpine with Python 3.12.10.

@wisp3rwind
Copy link
Member

Probably python-poetry/poetry#10083 and I think there might have been a 1.8 -> 2.x version bump for poetry?

@snejus snejus self-assigned this May 14, 2025
@snejus snejus linked a pull request May 14, 2025 that will close this issue
This was referenced May 14, 2025
@snejus snejus closed this as completed in 69a76ed May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants