texterrors icon indicating copy to clipboard operation
texterrors copied to clipboard

Bad CRC-32 for Darwin when updating to 1.0.8

Open ChrisRahme-Innovum opened this issue 7 months ago • 5 comments

Hello,

Updating texterrors from 1.0.7 to 1.0.8 fails on Mac with Python 3.12.8. This is the result of poetry install:

  - Updating texterrors (1.0.7 -> 1.0.8): Failed

  BadZipFile

  Bad CRC-32 for file 'texterrors_align.cpython-312-darwin.so'

  at ~/.pyenv/versions/3.12.8/lib/python3.12/zipfile/__init__.py:1007 in _update_crc
      1003│             return
      1004│         self._running_crc = crc32(newdata, self._running_crc)
      1005│         # Check the CRC if we're at the end of the file
      1006│         if self._eof and self._running_crc != self._expected_crc:
    → 1007│             raise BadZipFile("Bad CRC-32 for file %r" % self.name)
      1008│ 
      1009│     def read1(self, n):
      1010│         """Read up to n bytes with at most one read() system call."""
      1011│ 

Cannot install texterrors.

ChrisRahme-Innovum avatar Apr 11 '25 09:04 ChrisRahme-Innovum

Thanks for the report! To be honest it's not clear to me what's going on here. Does uninstalling 1.0.7 and installing 1.0.8 work?

RuABraun avatar Apr 11 '25 14:04 RuABraun

Nope, I just cannot install 1.0.8 at all on Mac Here is the output of pip install texterrors==1.0.8 in a clean environment:

ERROR: Exception:
Traceback (most recent call last):
  File "python3.12/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File "python3.12/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "python3.12/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "python3.12/site-packages/pip/_internal/commands/install.py", line 457, in run
    installed = install_given_reqs(
                ^^^^^^^^^^^^^^^^^^^
  File "python3.12/site-packages/pip/_internal/req/__init__.py", line 70, in install_given_reqs
    requirement.install(
  File "python3.12/site-packages/pip/_internal/req/req_install.py", line 867, in install
    install_wheel(
  File "python3.12/site-packages/pip/_internal/operations/install/wheel.py", line 732, in install_wheel
    _install_wheel(
  File "python3.12/site-packages/pip/_internal/operations/install/wheel.py", line 590, in _install_wheel
    file.save()
  File "python3.12/site-packages/pip/_internal/operations/install/wheel.py", line 380, in save
    shutil.copyfileobj(f, dest, blocksize)
  File "python3.12/shutil.py", line 203, in copyfileobj
    while buf := fsrc_read(length):
                 ^^^^^^^^^^^^^^^^^
  File "python3.12/zipfile/__init__.py", line 989, in read
    data = self._read1(n)
           ^^^^^^^^^^^^^^
  File "python3.12/zipfile/__init__.py", line 1079, in _read1
    self._update_crc(data)
  File "python3.12/zipfile/__init__.py", line 1007, in _update_crc
    raise BadZipFile("Bad CRC-32 for file %r" % self.name)
zipfile.BadZipFile: Bad CRC-32 for file 'texterrors_align.cpython-312-darwin.so'

ChrisRahme-Innovum avatar Apr 14 '25 06:04 ChrisRahme-Innovum

Ok thank you for trying that let me look into it more.

RuABraun avatar Apr 14 '25 15:04 RuABraun

Does installing with --no-binary work for you?

You probably already took care of this by using a clean environment but pip can share the cache, I would be curious to know if you get the same error with pip install --no-cache .... Additionally, what's your specific macOS version and does it have the M1/2 etc. chips or is it intel?

RuABraun avatar Apr 14 '25 16:04 RuABraun

It works with --no-binary, but not with --no-cache I am on macOS Sequoia 15.4 with M3 chip, though this has been reported by other Mac users as well who may have different versions or chips

ChrisRahme-Innovum avatar Apr 15 '25 11:04 ChrisRahme-Innovum

This is also reported on Github Actions Mac runner that runs python 3.12, versions lower than 3.12 work correctly though https://github.com/MahmoudAshraf97/whisper-diarization/actions/runs/14584989837/

MahmoudAshraf97 avatar Apr 22 '25 10:04 MahmoudAshraf97

Missed your edit Chris. I'm a little stumped by this and quite busy right now but I'll aim to have another look at this by the end of the week.

RuABraun avatar Apr 22 '25 19:04 RuABraun

I guess this might be fixed by simply reuploading the packages again, in the future, I'd suggest using a CI build and push action to test packages across different OSes and architetures before uploading, I implemented something similar Here

MahmoudAshraf97 avatar Apr 22 '25 19:04 MahmoudAshraf97

Yea i was thinking about a reupload. I did actually test on an m3 mac, not sure about the version right now. I like the idea of testing in CI I'll try that

RuABraun avatar Apr 22 '25 20:04 RuABraun

Took your advice Mahmoud: https://github.com/RuABraun/texterrors/actions/runs/14699243274

There's a new version @ChrisRahme-Innovum hope it works?

RuABraun avatar Apr 28 '25 03:04 RuABraun

It does! Thanks :)

ChrisRahme-Innovum avatar Apr 28 '25 05:04 ChrisRahme-Innovum

Also working on my end, Thanks

MahmoudAshraf97 avatar Apr 28 '25 13:04 MahmoudAshraf97