-
Notifications
You must be signed in to change notification settings - Fork 98
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
Regression (probably) parsing METADATA.pb #2200
Comments
Another example, probably related: http://35.225.170.228/report/0bdc5b01-cead-4ee1-82c6-91fda8e08fac This is Lato from current google/fonts@master. We get many of these:
|
One more similar:
or http://35.225.170.228/report/0bdc5b01-cead-4ee1-82c6-91fda8e08fac Example:
|
I am astonished to see this with py3 code. |
I think this is not a bug in our code. I investigated it a bit further. The offending character in that string is clearly the 'é'. I started by using the interactive python debugger and traced the execution of the protobuf code from my local virtualenv: Then I tried the same bytes in the python shell and reproduced the crash: I also noticed that when I encode the "JM Solé" string with the utf-8 encoding, I get a different sequence of bytes: So, I used hexdump to confirm that METADATA.pb has the ASCII 'é' ( I am not sure yet why, but the protobuf python package somehow managed to read UTF-8 from the METADATA.pb file and then ended up with 8-bit ASCII and then crashed while trying to interpret it as UTF-8... |
I continued investigating and found this: It seems that the 8-bit ASCII string is being created at So I googled. And I think this gives us the answer: I looked up the sources of my locally installed protobuf and it is indeed encoding the string into "ascii" and it does not yet include the patch from that pull request (protocolbuffers/protobuf#4804). |
I patched my local protobuf and now the fontbakery check/081 PASSes withut a crash. The upstream bugfix is from 2018 July 20. There was a release on July (protobuf 3.6.1) and it is available on PyPI. Our setup.py does not specify a version, so I would expect that a pip install would get us the latest version, and I can confirm that I do indeed have 3.6.1 installed: So, maybe that pull request was later reverted? I'll try to figure out. |
yeah... it was reverted: protocolbuffers/protobuf#4804 (comment) And the problem is currently being tracked at protocolbuffers/protobuf#4721 (and they're already talking about Google Fonts repo METADATA.pb files in there :-D) |
Was going to file a separate issue, but realized it would be a duplicate. So, I'll do a +1 here so that it might show up in other searches a little better... METADATA.pb fails to parse when there is a non-ASCII character (e.g. in a designer's name)Observed behaviourSignika is designed by Anna Giedryś. Unfortunately, if Anna's proper name is placed in
...causes this: 💔 A bunch of FontBakery METADATA fails💔 ERROR: Check METADATA.pb parse correctly.
💔 ERROR: Font designer field in METADATA.pb must not be 'unknown'.
💔 ERROR: METADATA.pb: Fontfamily is listed on Google Fonts API?
💔 ERROR: METADATA.pb: check if fonts field only has unique "full_name" values.
💔 ERROR: METADATA.pb: check if fonts field only contains unique style:weight pairs.
💔 ERROR: METADATA.pb license is "APACHE2", "UFL" or "OFL"?
💔 ERROR: METADATA.pb should contain at least "menu" and "latin" subsets.
💔 ERROR: METADATA.pb subsets should be alphabetically ordered.
💔 ERROR: METADATA.pb: Copyright notice is the same in all fonts?
💔 ERROR: Check that METADATA.pb family values are all the same.
💔 ERROR: METADATA.pb: According Google Fonts standards, families should have a Regular style.
💔 ERROR: METADATA.pb: Regular should be 400.
Whereas this metadata:
...yields this result: Expected behaviourIt is incorrect to spell Anna's name with no Hoping for a new protobuff release soon. 🙏 |
Protobuf 3.7.0 was released. We will use it on the next fontbakery release. I have just updated requirements.txt |
Special note to protobuf version 3.7.0 which includes a fix for a bug that affected fontbakery (issue fonttools#2200)
Special note to protobuf version 3.7.0 which includes a fix for a bug that affected fontbakery (issue #2200)
I have just re-run fontbakery on Signika and the parsing errors are gone. Cheers! |
Nice; thanks! |
a bug that affected parsing some METADATA.pb files correctly. (issue fonttools#2200)
(with fontbakery 0.6.1)
Alfa Slab One (METADATA.pb from 2016!!!)
E.g. http://35.225.170.228/report/2763e5df-29e1-4b80-9d68-bfc53400a4e9
(source is the same as in https://github.com/google/fonts/tree/fb839dd24542f8f1b0678af6f74335553ee8e61a/ofl/alfaslabone)
Example:
also:
But, there's also a failed attempt parsing METADATA.pb due to unknown fields defined in the file. Thus we should have the chck and condition
does_METADATA_parse
:(I don't know where these tested files came from)
http://35.225.170.228/report/d8819464-9208-46cd-9151-903dfd0f4b93
The text was updated successfully, but these errors were encountered: