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

ERROR with "Multi-line basic strings are surrounded by three quotation marks" #113

Closed
KMiNT21 opened this issue Jul 28, 2017 · 4 comments
Closed

Comments

@KMiNT21
Copy link

KMiNT21 commented Jul 28, 2017

https://github.com/toml-lang/toml#user-content-string

This lib doesn't work with strings are surrounded by three quotation mark as it can be by "Tom's Obvious, Minimal Language" specification.

Example:

some_var = """
sdfsd fds dsfsdfsd sdfds 
sdfsdf dsfdsfsds dsfsdf
SDfsdfdsfsdf"""

"File "C:\Python\Python35\lib\site-packages\toml.py", line 463, in _load_value
raise TomlDecodeError("Stuff after closed string. WTF?")
toml.TomlDecodeError: Stuff after closed string. WTF?"

@jmholla
Copy link

jmholla commented Aug 9, 2017

Your example doesn't seem to reproduce. Does the bug require a nested structure?

import toml

toml_str = '''\
some_var = """
sdfsd fds dsfsdfsd sdfds
sdfsdf dsfdsfsds dsfsdf
SDfsdfdsfsdf"""'''

print(toml.loads(toml_str))

@KMiNT21
Copy link
Author

KMiNT21 commented Aug 9, 2017

I have tried to load data from many "config.toml" (different GOHUGO templates configs):

toml.load(filename)

And found this problem with configs where these multi-strings was found.
Changing to simple "string" fix this problem.

@nagisa
Copy link

nagisa commented Aug 24, 2017

Something like

toml.loads('''foo = """bar "baz" qux"""''')

certainly reproduces.

@uiri
Copy link
Owner

uiri commented Aug 28, 2017

@nagisa that looks like it might be a separate bug related to having single quote strings inside triple quote strings.

@KMiNT21 Hi Mykhail, I am having trouble reproducing this in a *nix environment. Maybe this is a Windows issue? Do you have an *nix (i.e. Linux, Mac, BSD) environment you can test the buggy toml files in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants