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

Struct error when trying to run the bulk script on the entire GF library #15

Closed
NeilSureshPatel opened this issue Dec 13, 2022 · 1 comment

Comments

@NeilSureshPatel
Copy link
Contributor

I attempted to run `bulk-sg-run.py' on the full GF library and the process quit with the following stack trace after processing a number of fonts. I am not sure if it is related to a specific font or not.

analyzing fontsfull/novamono/NovaMono.ttf
analyzing fontsfull/yomogi/Yomogi-Regular.ttf
analyzing fontsfull/assistant/Assistant[wght].ttf
analyzing fontsfull/notosanselbasan/NotoSansElbasan-Regular.ttf
analyzing fontsfull/fasterone/FasterOne-Regular.ttf
analyzing fontsfull/notoseriflao/NotoSerifLao[wdth,wght].ttf
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/home/neilspatel/Shaperglot/shaperglot-env/bulk-sg-run.py", line 116, in check_one
    results_for_font[tag] = checker.check(gflangs[item])
  File "/home/neilspatel/.local/lib/python3.9/site-packages/shaperglot/checker.py", line 58, in check
    skip_reason = check_object.should_skip(self)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/shaperglot/checks/common.py", line 86, in should_skip
    checker.ttfont.get(table)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/ttFont.py", line 455, in get
    return self[tag]
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/ttFont.py", line 406, in __getitem__
    table = self._readTable(tag)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/ttFont.py", line 423, in _readTable
    table.decompile(data, self)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/tables/otBase.py", line 77, in decompile
    self.table.decompile(reader, font)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/tables/otBase.py", line 908, in decompile
    table[conv.name] = conv.read(reader, font, table)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/tables/otConverters.py", line 479, in read
    value = reader.readLong()
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/tables/otBase.py", line 288, in readLong
    return self.readValue("i", staticSize=4)
  File "/home/neilspatel/.local/lib/python3.9/site-packages/fontTools/ttLib/tables/otBase.py", line 266, in readValue
    value, = struct.unpack(f">{typecode}", self.data[pos:newpos])
struct.error: ('unpack requires a buffer of 4 bytes', 'Version')
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/neilspatel/Shaperglot/shaperglot-env/bulk-sg-run.py", line 169, in <module>
    main()
  File "/home/neilspatel/Shaperglot/shaperglot-env/bulk-sg-run.py", line 146, in main
    all_font_results = p.starmap(check_one, args)
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 372, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 771, in get
    raise self._value
struct.error: ('unpack requires a buffer of 4 bytes', 'Version')
[1]+  Killed                  python bulk-sg-run.py ./fonts/
@NeilSureshPatel
Copy link
Contributor Author

This may no longer be an issue. After making the changes in 910aeda, I don't get this error anymore. It may have been related to my resource issue.

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

2 participants