noriah / PyVDF

Python Library for Reading and Writing VDFs (Valve Data File)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyVDF fails to open appinfo.vdf

tralph3 opened this issue · comments

Hi, the program fails to open this file that's found on PATH_TO_STEAM/steam/appcache/appinfo.vdf. I want to use the module to create a program similar to Steam Edit but for Linux. However whenever I try to load this file with the .load method, or even using your other program vdfedit I get the same exception, I'll post the output here:

Traceback (most recent call last):
  File "./vdfedit", line 158, in <module>
    main()
  File "./vdfedit", line 118, in main
    vdf.load(args.infile)
  File "/home/tralph3/.local/lib/python3.8/site-packages/PyVDF/__init__.py", line 295, in load
    self.__data = PyVDF.read(f)
  File "/home/tralph3/.local/lib/python3.8/site-packages/PyVDF/__init__.py", line 112, in read
    data = PyVDF.reads(filec.read())
  File "/usr/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x87 in position 32: invalid start byte

Thanks for leaving a bug report. I won't have bandwidth to work on this for the foreseeable future. If you wish to submit a PR, I'd gladly review it.

If you need this to work, I'd recommend you make use of a more recently maintained library, like https://github.com/ValvePython/vdf

Thanks!