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

Inline table support #40

Closed
Jenselme opened this issue Jul 24, 2015 · 5 comments
Closed

Inline table support #40

Jenselme opened this issue Jul 24, 2015 · 5 comments

Comments

@Jenselme
Copy link
Contributor

When I try to parse a file that contains an inline table (as defined by toml 0.4, the parser crashes. For intance, with:

origins_to_ranks = {nomderue = 20, communes = 10}

I get.

  File "/home/jenselme/Stage3A/geo-api3/chsdi/tests/functional/test_sphinx.py", line 26, in test_sphinx_api_query
    config = toml.load(config_file)
  File "/home/jenselme/Stage3A/geo-api3/.venv/lib/python3.4/site-packages/toml.py", line 43, in load
    return loads(f.read(), _dict)
  File "/home/jenselme/Stage3A/geo-api3/.venv/lib/python3.4/site-packages/toml.py", line 331, in loads
    value, vtype = load_value(pair[1])
  File "/home/jenselme/Stage3A/geo-api3/.venv/lib/python3.4/site-packages/toml.py", line 453, in load_value
    parsed_date = load_date(v)
  File "/home/jenselme/Stage3A/geo-api3/.venv/lib/python3.4/site-packages/toml.py", line 350, in load_date
    tz = TomlTz(val[19:24])
  File "/home/jenselme/Stage3A/geo-api3/.venv/lib/python3.4/site-packages/toml.py", line 9, in __new__
    self._hours = int(toml_offset[:3])
ValueError: invalid literal for int() with base 10: 'omm'

Can you add support for this syntax please?

@oconnor663
Copy link

Ran into this issue myself. toml is failing to parse this example from the spec:

points = [ { x = 1, y = 2, z = 3 },
           { x = 7, y = 8, z = 9 },
           { x = 2, y = 4, z = 8 } ]

@ldav1s
Copy link

ldav1s commented Feb 16, 2016

I ran into this too. I was able work around it by reformulating the inline tables as an array of tables which worked.

@uiri uiri closed this as completed in 0db58f5 Apr 4, 2016
@Jenselme
Copy link
Contributor Author

Jenselme commented Apr 7, 2016

Can we have a new release with the support for inline table?

@Jenselme
Copy link
Contributor Author

@uiri Any plans on doing a new release to pypi with inline objects support?

@uiri
Copy link
Owner

uiri commented May 9, 2016

Assuming no further issues nor pull requests present themselves in the mean time, I plan on doing a new release once the timezone issue and the current pull requests are resolved.

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