tjvr / kurt

Python library for reading/writing MIT's Scratch file format.
https://kurt.tjvr.org
GNU General Public License v3.0
86 stars 24 forks source link

Bug loading a watcher #36

Open tjvr opened 7 years ago

tjvr commented 7 years ago

Found via scratch-corpus, loading Variable Names.sb2:

/usr/local/lib/python2.7/site-packages/kurt-2.0.7-py2.7.egg/kurt/__init__.pyc in value(self)
    951         """
    952         if self.kind == 'variable':
--> 953             return self.target.variables[self.block.args[0]]
    954         elif self.kind == 'list':
    955             return self.target.lists[self.block.args[0]]

KeyError: u'\u062b\u0645 \u0646\u0641\u0633 \u0633\u0642\u0637\u062a \u0648\u0628\u0627\u0644\u062a\u062d\u062f\u064a\u062f\u060c'

Looks like the variable name in the watcher is being split on commas for some reason! https://github.com/tjvr/kurt/blob/master/kurt/scratch20/__init__.py#L240-L241 I have no idea why I did this.

nathan commented 7 years ago

I have no idea why I did this.

The senseVideoMotion watcher used to do this. (https://github.com/LLK/scratch-flash-common/commit/05ead51dec0c42f599bba049949ef1b38ed53915)

tjvr commented 7 years ago

@nathan Thank you so much! I can safely remove that then :)