-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Nested square brackets inside sections are incorrectly parsed #121
Comments
Thanks @Delgan for posting this issue and providing a PR at the same time. It's highly appreciated. @abravalheri: What is your take on this? Can we merge and make a new release? If yes, it would be release |
New release would be great! |
Apparently this behaviour of For Python < 3.10, the reproducer prints To be honest the last 2 examples in the PR test are very counter intuitive to me, but since cpython itself is doing it, I guess we have to follow... Something to be aware though is that on Python < 3.10, |
This also would result in a very unintuitive behaviour:
Never mind, if you instantiate |
Oh, good catch, I didn't even realize that.
We could build something around
It would like the behavior of CPython to be changed as well. However, we made the assumption that Although it would still make sense to stop the section name when encountering a closing bracket matching the opening one, this behavior can't be implemented with a Python regex (it requires recursion), but as the regex is public (see above), it would be a breaking change for a feature not even meant to be supported... |
Being pragmatic, I think we can just be "forward"- compatible. I am happy that if the users specify The PR looks good to me, @FlorianWilhelm . My impression is that it is 100% compatible with the Python 3.10 code base. I haven't checked with |
Thanks @abravalheri, feel free to merge and close this issue :-) |
Description of your problem
Hi!
I noticed difference between standard
configparser
andconfigupdater
parsing.Please provide a minimal, self-contained, and reproducible example.
Given this INI file:
Using
configparser
:Using
configupdater
:Please provide the full traceback.
N/A
Please provide any additional information below.
It seems it's interpreted as being a comment.
I'll try to open a PR if I can figure it ouy.
Versions and main components
master
The text was updated successfully, but these errors were encountered: