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

Multi-line literal strings parsing error #398

Open
electriquo opened this issue May 26, 2022 · 2 comments
Open

Multi-line literal strings parsing error #398

electriquo opened this issue May 26, 2022 · 2 comments
Labels
component: decoder Related to parsing in `toml.load` syntax: strings Related to string literals type: bug A confirmed bug or unintended behavior

Comments

@electriquo
Copy link

toml fails for some multi-line literal strings. for example,

>>> import toml
>>> toml.loads("""foo = '''[']["]'''""")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/foo/.venv/lib/python3.9/site-packages/toml/decoder.py", line 362, in loads
    raise TomlDecodeError("Unterminated string found."
toml.decoder.TomlDecodeError: Unterminated string found. Reached end of file. (line 1 column 19 char 18)

other toml tools has no issue handling this case. for example,

$ cat <<EOM | yq -r
foo = '''[']["]'''
EOM
foo = '''[']["]'''
@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior component: decoder Related to parsing in `toml.load` syntax: strings Related to string literals labels Jun 4, 2022
@cpontvieux-systra
Copy link

I got the same error with gitleaks.toml files.

@cpontvieux-systra
Copy link

This is the same bug as #387

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

No branches or pull requests

3 participants