ValvePython / vdf

📜 Package for working with Valve's text and binary KeyValue format
https://pypi.org/project/vdf/
MIT License
165 stars 30 forks source link

Getting `SyntaxError: Unterminated cstring (offset: 1)` when trying to load shortcuts #51

Closed TheOddler closed 1 year ago

TheOddler commented 1 year ago

I'm trying to read and edit the shortcuts.vdf file, but something is going wrong, as I get the error SyntaxError: Unterminated cstring (offset: 1). Is it me that is doing something wrong, or is this a bug?

My code:

import vdf

shortcutsFileLocation = "/home/user/.steam/steam/userdata/1234/config/localconfig.vdf"
shortcutsFile = open(shortcutsFileLocation, "rb")
shortcutsBytes = shortcutsFile.read()

shortcuts = vdf.binary_loads(shortcutsBytes)
rossengeorgiev commented 1 year ago

Can't possible answer that without the file

TheOddler commented 1 year ago

Fair enough, file attached ;)

shortcuts.zip

TheOddler commented 1 year ago

Found what I did wrong, accidentally reading the localconfig file, rather then shortcuts... Stupidly copied the wrong path. Sorry!