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

When dumping Paths with double backslash it maintains the double backslash #38

Open elamhut opened 3 years ago

elamhut commented 3 years ago

As title implies when dumping something like:

"DepotBuildConfig" { "DepotID" "123456789" "contentroot" "d:\\NekoNeko\\Build" "FileMapping" { "LocalPath" "" "DepotPath" "." "recursive" "1" } "FileExclusion" ".pdb" }

The path maintains its double backslashes when dumped

rossengeorgiev commented 3 years ago

Duplicate of #28

rossengeorgiev commented 3 years ago

My bad, the other issue with \ as the last character. You can use escaped=False to disable escaping.

>>> print(vdf.dumps({'path': 'd:\\NekoNeko\\Build'}, escaped=False))
"path" "d:\NekoNeko\Build"