-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Fix values similar to booleans being incorrectly parsed to booleans #168
Conversation
Previously something like `a = truely` would be parsed to `true`.
Sorry, I revisited the original issue and fix, and came up with a different fix approach. The real problem here are 1) the error isn't thrown correctly and 2) the The parsing of boolean values is correct and doesn't need a fix. So can you kindly revert the change in parsing but ensure the EOF is reached after value parsing. This approach doesn't only fix the boolean parsing, but it also fixes other incomplete parsings like Thanks for your patience. |
I'm not sure I follow exactly. Can you provide me with some tests that reproduce the behaviour you expect? Or some examples? |
tomlkit.value('"foo"1.2')
# should reject the current behavior parses as 'foo' but it doesn't reach the end. |
If I understand you correctly, we should check if EOF was reached when parsing a value? if not self.end():
raise ParseError |
lgtm, but it only applies to value api so it should be parser.end() also a meaningful error message would be good |
LGTM! Thanks |
@frostming thanks for the help! Is there a chance to get a new release with this bugfix soon? |
Fix values similar to booleans being incorrectly parsed to booleans
This included values that strat with
t
orf
liketest
andfriend
as well as values that havetrue
orfalse
as prefix liketruely
andfalsely
.All of them are now incorrectly rejected by
tomlkit.value
.Closes #165