8000 mixed types in array don't work · Issue #270 · uiri/toml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
mixed types in array don't work #270
Open
@vanyakosmos

Description

@vanyakosmos
[config]
list = [
  { key = "value"},
  "foo",
]

this way file will be parsed but "foo" will be ignored: {config: {list: [{key: value}]}}


[config]
list = [
  "foo",
  { key = "value"},
]

After parsing toml file above parser will throw an error: IndexError: list index out of range.
Traceback:

  File "/path/to/lib/python3.7/site-packages/toml/decoder.py", line 456, in loads
    multibackslash)
  File "/path/to/lib/python3.7/site-packages/toml/decoder.py", line 725, in load_line
    value, vtype = self.load_value(pair[1], strictly_valid)
  File "/path/to/lib/python3.7/site-packages/toml/decoder.py", line 802, in load_value
    return (self.load_array(v), "array")
  File "/path/to/lib/python3.7/site-packages/toml/decoder.py", line 914, in load_array
    a[b] = a[b] + ',' + a[b + 1]
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    syntax: arraysRelated to arraystype: featureA self-contained enhancement or new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0