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

Hex integer values aren't decoded #202

Closed
vlotorev opened this issue Oct 2, 2018 · 1 comment
Closed

Hex integer values aren't decoded #202

vlotorev opened this issue Oct 2, 2018 · 1 comment

Comments

@vlotorev
Copy link

vlotorev commented Oct 2, 2018

TOML v0.5.0 supports hex/octal/bin integer values: https://github.com/toml-lang/toml#integer (TOML v0.4.0 doesn't support these).

python-toml 0.9.6 doesn't support hex/octal/bin integer value although link to TOML 0.5.0 was bumped (a444a36#diff-88b99bb28683bd5b7e3a204826ead112).
BurntSushi/toml-test doesn't have tests for TOML v0.5.0 see toml-lang/toml-test#49 so it's not clear why python-toml is considered to support TOML 0.5.0

[vlotorev@host ~]$ python3 -c "import toml; toml.loads('a=0x1')"
Traceback (most recent call last):
  File "/home/vlotorev/.local/lib/python3.4/site-packages/toml.py", line 400, in loads
    multibackslash)
  File "/home/vlotorev/.local/lib/python3.4/site-packages/toml.py", line 516, in _load_line
    raise ValueError("Invalid date or number")
ValueError: Invalid date or number

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/vlotorev/.local/lib/python3.4/site-packages/toml.py", line 402, in loads
    raise TomlDecodeError(str(err))
toml.TomlDecodeError: Invalid date or number

the same error fires for 'a=0b1' and 'a=0o1'.

Note:

@uiri
Copy link
Owner

uiri commented Oct 4, 2018

Thank you for this issue. I believe this is a duplicate of #150

@uiri uiri closed this as completed Oct 4, 2018
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