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

Boolean value in document causes erratic comparison results #56

Closed
uranusjr opened this issue Jul 23, 2019 · 2 comments
Closed

Boolean value in document causes erratic comparison results #56

uranusjr opened this issue Jul 23, 2019 · 2 comments

Comments

@uranusjr
Copy link

uranusjr commented Jul 23, 2019

Via sarugaku/plette#9.

>>> import tomlkit
>>> s = """
... [foo]
... value = false
... """
>>> tomlkit.parse(s) == {'foo': {'value': False}}    # This works correctly.
True
>>> tomlkit.parse(s)['foo'] == {'value': False}      # This does not.
False

At a quick glance, tomlkit.items.Bool seems to be the problem here.

>>> d = tomlkit.parse(s)
>>> d
{'foo': [{'value': False}]}
>>> d['foo']
{'value': <tomlkit.items.Bool object at 0x10c9ac780>}
@Alexis-Prel
Copy link

I just stumbled upon the exact same bug. This really is a big problem.

@uranusjr have you encountered any issue with your fix #57 so far?

@frostming
Copy link
Contributor

This was fixed

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

Successfully merging a pull request may close this issue.

3 participants