justinpenner / TalkingLeaves

A GlyphsApp plugin to help you explore the world’s languages and writing systems
MIT License
27 stars 2 forks source link

crash #21

Closed justanotherfoundry closed 3 weeks ago

justanotherfoundry commented 3 weeks ago

Details: Traceback (most recent call last):

File "plugin.py", line 49, in openWindow_ self.tl = TalkingLeaves() ^^^^^^^^^^^^^^^

File "TalkingLeaves.py", line 85, in init self.scriptsData = self.getScriptsAndSpeakers() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "TalkingLeaves.py", line 371, in getScriptsAndSpeakers speakers[ortho['script']] += lang.get('speakers', 0)

TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

App:3.3-3310 Plugin:0.1-2 System:14.5.0

Seems like lang.get('speakers', 0) may be None (as an existing value, not because it does not exist).

justanotherfoundry commented 3 weeks ago

This is related to Hyperglot 0.6.4. After downgrading to Hyperglot 0.6.3, the crash does not happen any more. Btw, Hyperglot 0.6.4 also seems to cause further crashes, which I have not investigated any more.

justinpenner commented 3 weeks ago

Thanks for raising this so quickly! Looks like Hyperglot 0.6.4 was pushed out while I was sleeping. They made some changes to how the properties of their Language class are accessed, as well as the default values for the properties. I just pushed out a fix in 07107f9, which seems to work with both 0.6.3 and 0.6.4 now.

I also noticed TalkingLeaves wasn't notifying me that a new Hyperglot version was available, so I fixed that in a183765.

Also, FYI if you've noticed any performance issues, I have an update coming that refactors all the data processing into a separate module with some changes to improve performance, including truncating the Missing Chars column and using pandas to process all the language data faster.

justanotherfoundry commented 3 weeks ago

Excellent. Thanks!