We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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?
The text was updated successfully, but these errors were encountered:
I've just bumped into this--or something much like it--myself.
Specifically, it looks to me like TOML, when presented with a backslash (whether alone or escaped), outputs two backslashes in its place.
For example, the following program:
import toml mew = "cat = 'this is a \ test'" result = toml.loads(mew) print (result)
produces the following output on my machine: {'cat': 'this is a \\ test'}
{'cat': 'this is a \\ test'}
Note that the single backslash has become a double backslash.
TOML version: 1.10.2, I believe OS: Ubuntu Linux 22.04.5
Sorry, something went wrong.
No branches or pull requests
When I dump something contains backslash to file and then load it, there are double backslashes. Like the below:
This will print:
I don't know if this is a bug or just a feature. If this is a feature, how can I avoid this?
The text was updated successfully, but these errors were encountered: