-
Notifications
You must be signed in to change notification settings - Fork 193
Open
Description
I'm having problems with Windows paths stored in toml files:
In [1]: import toml
In [2]: foo = {'a': 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\Lib\\site-packages\\PyQt5\\bindings'}
In [3]: d = toml.dumps(foo)
In [4]: d
Out[4]: 'a = "C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\\\Lib\\\\site-packages\\\\PyQt5\\\\bindings"\n'
In [5]: toml.loads(d)
/usr/lib/python3/dist-packages/toml/decoder.py in loads(s, _dict, decoder)
512 multibackslash)
513 except ValueError as err:
--> 514 raise TomlDecodeError(str(err), original, pos)
515 if ret is not None:
516 multikey, multilinestr, multibackslash = ret
TomlDecodeError: Reserved escape sequence used (line 1 column 1 char 0)
It looks like only some backslashes are escaped properly by dumps. I tested this with toml from github.
Edward-Knightdavidfokkema
Metadata
Metadata
Assignees
Labels
No labels