You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] TypeError: 'bool' object is not iterable #11
I get the same TypeError: 'bool' object is not iterable on Sublime Text build 4215 (Windows 11, BoundKeys from Package Control). Console:
Error parsing JSON: Illegal trailing comma before end of object: line 59 column 4 (char 2977)
Error parsing JSON: Illegal trailing comma before end of object: line 6 column 71 (char 173)
Error parsing JSON: Illegal trailing comma before end of object: line 150 column 10 (char 6962)
Traceback ...
File ".../boundkeys.py", line 356, in run
for binding in userKeys[lastPath]["object"]:
TypeError: 'bool' object is not iterable
Cause: jsonify() returns False when a keymap does not parse (the strict json.loads rejects trailing commas inside objects, which Sublime Text's own parser accepts; the workaround only handles }, followed by ]). The zip branch (lines 301-307) stores that False as "object", and the loops at lines 349-359 then iterate over it.
Tested fix in a local copy: in jsonify() use return sublime.decode_value(data) (accepts comments and trailing commas like Sublime itself), and in the two loops test if subKeys[lastPath].get("object"): / if userKeys[lastPath].get("object"): instead of if "object" in .... With that the command no longer raises. (The results tab was then empty, a separate problem, filed separately.)
Activity
mg979 commentedon Apr 14, 2017
Possible fix, insert at line 43:
Kristinita commentedon Apr 15, 2017
@mg979 , I paste it right?
It doesn't work for me, I get the same error.
Thanks.
mg979 commentedon Apr 15, 2017
In my installation it works. I also had to do this.
Maybe you have something else yet that causes an error. What does the console say exactly?
dpc00 commentedon Oct 22, 2026
Claude reports:
I get the same
TypeError: 'bool' object is not iterableon Sublime Text build 4215 (Windows 11, BoundKeys from Package Control). Console:Cause:
jsonify()returnsFalsewhen a keymap does not parse (the strictjson.loadsrejects trailing commas inside objects, which Sublime Text's own parser accepts; the workaround only handles},followed by]). The zip branch (lines 301-307) stores thatFalseas"object", and the loops at lines 349-359 then iterate over it.Tested fix in a local copy: in
jsonify()usereturn sublime.decode_value(data)(accepts comments and trailing commas like Sublime itself), and in the two loops testif subKeys[lastPath].get("object"):/if userKeys[lastPath].get("object"):instead ofif "object" in .... With that the command no longer raises. (The results tab was then empty, a separate problem, filed separately.)