gh-103384: Generalize the regex pattern BaseConfigurator.INDEX_PATTERN to allow spaces and non-alphanumeric characters in keys.#103391
Conversation
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
|
I think a test with some special characters would also be useful :) |
Makes sense. Thanks for the suggestions. I will add some of those combinations. |
|
I'd also add tests for some edge cases like the empty string (if we want to allow that) and multiple nesting levels e.g. |
I have added a new nested dictionary to the existing template we use in the test. Added new assertions specifically for the nested cases.
Update: Added this anyways. |
Misc/NEWS.d/next/Library/2023-04-09-05-30-41.gh-issue-103384.zAV7iB.rst
Outdated
Show resolved
Hide resolved
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
BaseConfigurator.INDEX_PATTERN to allow spaces and non-alphanumeric characters in keys.BaseConfigurator.INDEX_PATTERN to allow spaces and non-alphanumeric characters in keys.
…AV7iB.rst Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Misc/NEWS.d/next/Library/2023-04-09-05-30-41.gh-issue-103384.zAV7iB.rst
Outdated
Show resolved
Hide resolved
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @vsajip: please review the changes made to this pull request. |
BaseConfigurator.INDEX_PATTERN to allow spaces and non-alphanumeric characters in keys.BaseConfigurator.INDEX_PATTERN to allow spaces and non-alphanumeric characters in keys.
|
@vsajip |
|
Sorry I've not had time to look at this. Hope to get to it soon. |
|
Should this be backported? |
|
Perhaps - it's arguable whether it's an enhancement or could have been considered a documentation bug. |
|
Ok; if no backport is needed, we should close the linked issue. |
The issue described a broken regex pattern in the logging module.
Fixed the regex and added tests for the same.
logging.configcfgprotocol rejects non-alphanumeric names, contrary to the documentation #103384