BSSReader reads literally everything #85

Open
opened 2014-12-12 20:00:14 +00:00 by Pigu-A · 1 comment
Pigu-A commented 2014-12-12 20:00:14 +00:00 (Migrated from github.com)

Not sure if this is a problem in my OS but a preprocessor somehow don't let me make it with this error:

Traceback (most recent call last):
    File "prequeue.py", line 11, in <module>
        import preprocessor
    File "/home/pigu/pokecrystal/preprocessor.py", line 30, in <module>
    from extras.pokemontools.battle_animations import (
    File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <module>
        objs  = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
    File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <dictcomp>
        objs  = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
TypeError: argument of type 'int' is not iterable

So I decided to print anims variable, it appears that it contains constant entries and every Python builtins entries as well...

http://pastebin.com/3nWbPHjK

So, is there a way to work around this problem?

Not sure if this is a problem in my OS but a preprocessor somehow don't let me make it with this error: ``` Traceback (most recent call last): File "prequeue.py", line 11, in <module> import preprocessor File "/home/pigu/pokecrystal/preprocessor.py", line 30, in <module> from extras.pokemontools.battle_animations import ( File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <module> objs = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v } File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <dictcomp> objs = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v } TypeError: argument of type 'int' is not iterable ``` So I decided to print anims variable, it appears that it contains constant entries and **every Python builtins** entries as well... http://pastebin.com/3nWbPHjK So, is there a way to work around this problem?
yenatch commented 2014-12-12 22:13:08 +00:00 (Migrated from github.com)

Instead of writing an expression parser, constants are intepreted with eval. eval optionally takes a dict of supplementary variables (globals). If __builtins__ isn't already a key, it's added to the dict.

This was addressed some time ago in 0dd6b20 but never merged into the main fork. This is fixed in #86.

Instead of writing an expression parser, constants are intepreted with `eval`. `eval` optionally takes a dict of supplementary variables (globals). If `__builtins__` isn't already a key, it's [added to the dict](https://docs.python.org/2/library/functions.html#eval). This was addressed some time ago in 0dd6b20 but never merged into the main fork. This is fixed in #86.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
decomp/pokemon-reverse-engineering-tools#85
No description provided.