-
-
Notifications
You must be signed in to change notification settings - Fork 32k
logging.config
cfg
protocol rejects non-alphanumeric names, contrary to the documentation
#103384
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
Comments
dhuadaar
added a commit
to dhuadaar/cpython
that referenced
this issue
Apr 9, 2023
dhuadaar
added a commit
to dhuadaar/cpython
that referenced
this issue
Apr 9, 2023
dhuadaar
added a commit
to dhuadaar/cpython
that referenced
this issue
Apr 9, 2023
dhuadaar
added a commit
to dhuadaar/cpython
that referenced
this issue
Apr 13, 2023
dhuadaar
added a commit
to dhuadaar/cpython
that referenced
this issue
Apr 16, 2023
AlexWaygood
added a commit
to dhuadaar/cpython
that referenced
this issue
May 2, 2023
erlend-aasland
added a commit
to dhuadaar/cpython
that referenced
this issue
Aug 4, 2023
dhuadaar
added a commit
to dhuadaar/cpython
that referenced
this issue
Aug 25, 2023
vsajip
added a commit
that referenced
this issue
Aug 25, 2023
…RN` to allow spaces and non-alphanumeric characters in keys. (GH-103391) Co-authored-by: Vinay Sajip <[email protected]> Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In
logging.config
, when using thecfg
protocol, names with spaces or non-alphanumeric characters (e.g.cfg://nested[prop with spaces]
) raise aValueError
contrary to what is stated in the documentation.The documentation states that one can use the bracket notation:
This does not work however:
ValueError
is also raised for any non-alphanumeric sequence:The culprit is the regex pattern (
BaseConfigurator.INDEX_PATTERN
) which is used for matching the bracket contents:^\[\s*(\w+)\s*\]\s*
.This only matches alphanumeric characters. Simply changing this to
^\[([^\[\]]*)\]\s*
would give us the behavior described in the docs.Your environment
Linked PRs
BaseConfigurator.INDEX_PATTERN
to allow spaces and non-alphanumeric characters in keys. #103391The text was updated successfully, but these errors were encountered: