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

Cant parse toml 0.3.1 language example #33

Closed
techdragon opened this issue Feb 17, 2015 · 1 comment
Closed

Cant parse toml 0.3.1 language example #33

techdragon opened this issue Feb 17, 2015 · 1 comment

Comments

@techdragon
Copy link

toml_string = """# This is a TOML document. Boom.

title = "TOML Example"

[owner]
name = "Lance Uppercut"
dob = 1979-05-27T07:32:00-08:00 # First class dates? Why not?

[database]
server = "192.168.1.1"
ports = [ 8001, 8001, 8002 ]
connection_max = 5000
enabled = true

[servers]

  # You can indent as you please. Tabs or spaces. TOML don't care.
  [servers.alpha]
  ip = "10.0.0.1"
  dc = "eqdc10"

  [servers.beta]
  ip = "10.0.0.2"
  dc = "eqdc10"

[clients]
data = [ ["gamma", "delta"], [1, 2] ]

# Line breaks are OK when inside arrays
hosts = [
  "alpha",
  "omega"
]"""
import toml
toml.loads(toml_string)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/techdragon/.pyenv/versions/test/lib/python3.4/site-packages/toml.py", line 283, in loads
    value, vtype = load_value(pair[1])
  File "/Users/techdragon/.pyenv/versions/test/lib/python3.4/site-packages/toml.py", line 431, in load_value
    v = int(v)
ValueError: invalid literal for int() with base 10: '1979-05-27T07:32:00-08:00'
@uiri
Copy link
Owner

uiri commented Feb 21, 2015

The datetime handling is currently not very robust. Per toml-lang/toml#263 the status of datetime literals in toml is not currently well defined. I am waiting for a resolution of that issue before investing more time in robust datetime parsing.

@uiri uiri closed this as completed in f4183c7 Feb 24, 2015
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

2 participants