-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
When I dump something contains backslash to file and then load it, there are double backslashes. Like the below:
import toml
with open('test.toml', 'w', encoding='utf-8') as f:
toml.dump({"c:\\test": {}}, f)
for _ in range(5):
with open('test.toml', encoding='utf-8') as f:
contents = toml.load(f)
print(contents)
with open('test.toml', 'w', encoding='utf-8') as f:
toml.dump(contents, f)This will print:
{'c:\\\\test': {}}
{'c:\\\\\\\\test': {}}
{'c:\\\\\\\\\\\\\\\\test': {}}
{'c:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\test': {}}
{'c:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\test': {}}
I don't know if this is a bug or just a feature. If this is a feature, how can I avoid this?
Metadata
Metadata
Assignees
Labels
No labels