Skip to content

TOMLDecodeError: Invalid initial character for a key part #199

@marxin

Description

@marxin

I noticed tomli is stricter than toml when it comes to whitespaces:

$ cat sample.toml
digests = [
  {
    key = "value",
    key2 = "value2"
  }
]
$ In [4]: toml.load('sample.toml')
Out[4]: {'digests': [{'key': 'value', 'key2': 'value2'}]}
$ In [5]: tomli.load(open('sample.toml', 'rb'))
...
    403     return parse_one_line_basic_str(src, pos)
--> 404 raise suffixed_err(src, pos, "Invalid initial character for a key part")

TOMLDecodeError: Invalid initial character for a key part (at line 2, column 4)

Is it something that can be relaxed, please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions