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

Bug with UCD data "BadZipFile" on first run #97

Open
belluzj opened this issue Oct 12, 2023 · 4 comments
Open

Bug with UCD data "BadZipFile" on first run #97

belluzj opened this issue Oct 12, 2023 · 4 comments

Comments

@belluzj
Copy link

belluzj commented Oct 12, 2023

It only happens when running the first time, then when running again it's fine, so maybe some timing issue, not waiting until the end of some download? And not blocking, since it's enough to restart the run. Here is the stacktrace:

[4/5] _diffenator "build/Font/variable/old-Font-Italic.ttf" "bui...um Italic-Text Bold Italic/Text-Bold-Italic' -ch ".*" --coords axes=...
FAILED: out/Bold Italic-Italic-Medium Italic-Text Bold Italic/Text-Bold-Italic
_diffenator "build/Font/variable/old-Font-Italic.ttf" "build/Font/variable/Font-Italic.ttf" -t 0.9 -o 'out/Bold Italic-Italic-Medium Italic-Text Bold Italic/Text-Bold-Italic' -ch ".*" --coords axes=...
Traceback (most recent call last):
  File "/home/jany_belluz/.local/bin/_diffenator", line 8, in <module>
    sys.exit(main())
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/diffenator2/_diffenator.py", line 83, in main
    diff.diff_all()
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/diffenator2/_diffenator.py", line 30, in diff_all
    getattr(self,f)()
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/diffenator2/_diffenator.py", line 39, in diff_words
    self.glyph_diff = test_fonts(self.old_font, self.new_font, threshold=self.threshold)
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/diffenator2/shape.py", line 53, in test_fonts
    words = test_font_words(font_a, font_b, skip_glyphs, threshold=threshold)
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/diffenator2/shape.py", line 87, in test_font_words
    data = ucd_data(k)
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/youseedee/__init__.py", line 176, in ucd_data
    out.update(props["datareader"](file, codepoint))
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/youseedee/__init__.py", line 73, in dictget
    fileentry["data"] = fileentry["reader"](filename)
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/youseedee/__init__.py", line 58, in parse_file_semicolonsep
    ensure_files()
  File "/home/jany_belluz/.local/pipx/venvs/diffenator2/lib/python3.10/site-packages/youseedee/__init__.py", line 40, in ensure_files
    with zipfile.ZipFile(zip_path, 'r') as zip_ref:
  File "/usr/lib/python3.10/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.10/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
@m4rc1e
Copy link
Collaborator

m4rc1e commented Nov 15, 2023

@simoncozens seems to be occurring due to youseedee

@simoncozens
Copy link
Contributor

Yeah, looks like it but I can't repro. :-/ @belluzj Could you

a) Clean out your ~/.youseedee folder and try again?
b) If it fails again, inspect ~/.youseedee/UCD.zip.

@RickyDaMa
Copy link

RickyDaMa commented Jan 17, 2024

To fix this in diffenator2, the youdeesee dependency needs to be updated to at least v0.5.0 (from ^0.3.0)

Unfortunately, trying this locally meant all the functional tests failed. Not sure if that's my environment or not, but it wasn't exactly encouraging :(

@m4rc1e
Copy link
Collaborator

m4rc1e commented Jan 17, 2024

@RickyDaMa I just updated youseedee to 0.5.0 and deleted ~/.youseedee and all checks pass (I'm on OS X).

Lemme open a PR and see what our win ci makes of it.

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

No branches or pull requests

4 participants