gftools icon indicating copy to clipboard operation
gftools copied to clipboard

Error with diffenator / 'NoneType' object is not iterable

Open RosaWagner opened this issue 3 years ago • 12 comments

Running on one variable font (Nunito)

INFO:__main__:Running Diffenator
Traceback (most recent call last):
  File "/Users/rosalie/Google/env/bin/gftools-qa.py", line 492, in <module>
    main()
  File "/Users/rosalie/Google/env/bin/gftools-qa.py", line 479, in main
    qa.diffenator()
  File "/Users/rosalie/Google/env/bin/gftools-qa.py", line 141, in diffenator
    for style in self.matching_instances:
TypeError: 'NoneType' object is not iterable

RosaWagner avatar Feb 16 '22 14:02 RosaWagner

I take it you're trying to run this pr, https://github.com/google/fonts/pull/4309 locally?

m4rc1e avatar Feb 16 '22 14:02 m4rc1e

yep

RosaWagner avatar Feb 16 '22 14:02 RosaWagner

Same issue with https://github.com/google/fonts/pull/4291 I reinstalled all the brew packages, and gftools gen-html diff -imgs works fine

RosaWagner avatar Feb 23 '22 10:02 RosaWagner

That CI issue happened because the issue was too long to post, not diffenator.

Exception: GitHub POST query failed to url https://api.github.com/repos/google/fonts/issues/4291/comments:
 [ { 'code': 'unprocessable',
    'field': 'data',
    'message': 'Body is too long (maximum is 65536 characters)',
    'resource': 'IssueComment'}]
Error: Process completed with exit code 1.

m4rc1e avatar Feb 23 '22 10:02 m4rc1e

but I am doing it locally not trying to post it

RosaWagner avatar Feb 23 '22 10:02 RosaWagner

I'm also getting the same problem here. This is before it tries to post anything:

$ PYTHONPATH=~/others-repos/gftools/Lib gftools qa -f *.ttf --diffenator
INFO:__main__:No regression checks possible since there are no previous fonts.
INFO:__main__:Running Diffenator
Traceback (most recent call last):
  File "/opt/homebrew/bin/gftools-qa.py", line 500, in <module>
    main()
  File "/opt/homebrew/bin/gftools-qa.py", line 487, in main
    qa.diffenator()
  File "/opt/homebrew/bin/gftools-qa.py", line 149, in diffenator
    for style in self.matching_instances:
TypeError: 'NoneType' object is not iterable

simoncozens avatar Feb 23 '22 12:02 simoncozens

Actually this is probably because it can't find the previous fonts, d'oh. Adding -fb ~/others-repos/fonts/ofl/notosans/*.ttf works...

simoncozens avatar Feb 23 '22 12:02 simoncozens

diffenator is supposed to load the fonts from GF

RosaWagner avatar Feb 23 '22 12:02 RosaWagner

If you add -a, yes?

simoncozens avatar Feb 23 '22 13:02 simoncozens

AH silly me, you were right, I forgot the -gfb argument, don't know why I thought it was doing it automatically.

RosaWagner avatar Feb 23 '22 13:02 RosaWagner

Ok this issue is therefore useless, I close it.

RosaWagner avatar Feb 23 '22 14:02 RosaWagner

tbh the error message could be better so I'm reopening this.

m4rc1e avatar Feb 23 '22 14:02 m4rc1e

We use diffenator2 so I think this is now stale. We also get a better error message now when a match cannot be found:

ValueError: Matcher was not able to detect any matching styles for instances method.
Please ensure that variable fonts have fvar instances, both fonts have designspaces which overlap or ensure that both sets of static fonts have some matching styles.

simoncozens avatar Sep 01 '23 09:09 simoncozens