Skip to content

Windows shortcut leads to parsing errors #42

@rotherwo

Description

@rotherwo

GC1051_NV_NV.lnk.txt

We are using pylnk3 for resolving Windows link files on macOS. Some link files can be resolved, others are running into error messages.
A sample file is attached.

Traceback (most recent call last):
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 2015, in
cli()
~~~^^
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1999, in cli
lnk = parse(args.filename)
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1769, in parse
return Lnk(lnk)
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1506, in init
self._parse_lnk_file(f)
~~~~~~~~~~~~~~~~~~~~^^^
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1573, in _parse_lnk_file
self.extra_data = ExtraData(lnk)
~~~~~~~~~^^^^^
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1455, in init
block = block_class(bytes=bytes)
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1174, in init
self.read(bytes)
~~~~~~~~~^^^^^^^
File "/Users/wolfgang.rothermel/scripts/./pylnk3.py", line 1180, in read
self.target_ansi = buf.read(260).decode('ansi')
~~~~~~~~~~~~~~~~~~~~^^^^^^^^
LookupError: unknown encoding: ansi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions