Skip to content

Broken parsing of triple-quoted strings in arrays #123

@bugreport1234

Description

@bugreport1234

I've got a toml file like this:

x=["""hello
world"""]

This looks like valid toml to me. However parsing it with the library gives the result:

>>> with open("test.toml") as file:
...     x = toml.load(file)
...
>>> x
{'x': ['h']}

It seems the string is just completely cut off after the first character. Changing the string content sometimes results in other cutoffs:

x=["""this is a test
"""]

results in:

{'x': ['this is a ']}

I'm using Python 3.6.1 and toml github master on windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: decoderRelated to parsing in `toml.load`syntax: stringsRelated to string literalstype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions