pylnk icon indicating copy to clipboard operation
pylnk copied to clipboard

Parse error `KeyError: 2717908993`

Open andry81 opened this issue 1 year ago • 0 comments

  • Windows 8.1 x64
  • Python x64 3.12.1
  • Branch: json

If try to parse that old shortcut format file: https://github.com/andry81/contools/blob/master/Scripts/Tools/ToolAdaptors/lnk/cmd.lnk

pylnk p cmd.lnk --json

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\Python\x64\312\Scripts\pylnk3.exe\__main__.py", line 7, in <module>
  File "c:\Python\x64\312\Lib\site-packages\pylnk3\cli.py", line 77, in main
    lnk = parse(args.filename)
          ^^^^^^^^^^^^^^^^^^^^
  File "c:\Python\x64\312\Lib\site-packages\pylnk3\helpers.py", line 42, in parse
    return Lnk(lnk)
           ^^^^^^^^
  File "c:\Python\x64\312\Lib\site-packages\pylnk3\structures\lnk.py", line 122, in __init__
    self._parse_lnk_file(f)
  File "c:\Python\x64\312\Lib\site-packages\pylnk3\structures\lnk.py", line 188, in _parse_lnk_file
    self.extra_data = ExtraData(lnk)
                      ^^^^^^^^^^^^^^
  File "c:\Python\x64\312\Lib\site-packages\pylnk3\structures\extra_data.py", line 411, in __init__
    block_type = EXTRA_DATA_TYPES[signature]
                 ~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 2717908993

Note: This is a legit valid shortcut file has been created with %COMSPEC% in the TargetPath property.

andry81 avatar Feb 06 '24 16:02 andry81