<html><body><div><span style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;">Hi,</span></div><div><br data-mce-bogus="1"></div><div><span style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;">I have a small utility that auto-generates documentation for the commands in a tmbundle by extracting key-combo and documentation comments from the command files, see:</span></div><div><span style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;"><a href="https://github.com/persquare/CalvinScript.tmbundle/blob/master/Support/lib/help_gen.py" style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;">https://github.com/persquare/CalvinScript.tmbundle/blob/master/Support/lib/help_gen.py</a></span></div><div><br data-mce-bogus="1"></div><div><span style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;">It works mostly well, but trying to parse a command file that contains a command mapped to the escape key using plistlib/biplist fails with an exception:</span></div><div><br data-mce-bogus="1"></div><div><span style="font-family: 'courier new', monospace;" data-mce-style="font-family: 'courier new', monospace;">InvalidPlistException: ExpatError('not well-formed (invalid token): line 18, column 9',)</span></div><div><br data-mce-bogus="1"></div><div>The (python) code to trigger is simple enough, plistlib or biplist doesn't matter:</div><div><span style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;"><br></span></div><div><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;">try:</span><br><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;">    import biplist as plistlib</span><br><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;">except:</span><br><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;">    import plistlib</span><br><br><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;"> for file in os.listdir(path_to_cmd_dir_in_tmbundle):</span><br><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;">   path = unicode(os.path.join(cmd_dir, file), 'utf-8')</span><br><span style="color: rgb(0, 0, 0); font-family: 'courier new', monospace;" data-mce-style="color: #000000; font-family: 'courier new', monospace;">    pl = plistlib.readPlist(path)</span></div><div><br data-mce-bogus="1"></div><div>Any clues how to handle this?</div><div><br data-mce-bogus="1"></div><div>/Per<br><span style="color: rgb(0, 0, 0);" data-mce-style="color: #000000;"> </span></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></body></html>