Skip to content
New issue

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

Incorrect string escaping in TOML encoder #201

Open
ghost opened this issue Sep 30, 2018 · 1 comment · May be fixed by #244
Open

Incorrect string escaping in TOML encoder #201

ghost opened this issue Sep 30, 2018 · 1 comment · May be fixed by #244
Labels
component: encoder Related to serialising in `toml.dump` syntax: strings Related to string literals type: bug A confirmed bug or unintended behavior

Comments

@ghost
Copy link

ghost commented Sep 30, 2018

While encoding string values, the TOML encoder incorrecty handles backslash characters that occur in the string value.

For example:

toml.dumps({"a": "\\x"})

returns

a = "\u00"

which is not valid TOML.

This bug also triggers failures in the encoder tests "escaped-escape" and "string-escapes" from the TOML test suite.

@LexiconCode
Copy link

LexiconCode commented Jan 5, 2019

@uiri This bug is affecting two projects I am affiliated with Caster and Dragonfly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: encoder Related to serialising in `toml.dump` syntax: strings Related to string literals type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants