Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-110875: Handle '.' properties in logging formatter configuration c… #110943

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

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

vsajip
Copy link
Member

@vsajip vsajip commented Oct 16, 2023

@AlexWaygood
Copy link
Member

Not sure I'm the best reviewer here -- not very familiar with this code, and haven't used logging.Formatter much. But I can try to take a look tomorrow :)

@vsajip
Copy link
Member Author

vsajip commented Oct 17, 2023

It's a fairly simple localised change 😄

@vsajip vsajip requested a review from iritkatriel November 2, 2023 20:36
Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same logic is in DictConfigurator.configure_handler as well. Does that need a fix too?

Lib/logging/config.py Outdated Show resolved Hide resolved
@AlexWaygood AlexWaygood removed their request for review November 3, 2023 13:33
@vsajip
Copy link
Member Author

vsajip commented Nov 3, 2023

The same logic is in DictConfigurator.configure_handler as well. Does that need a fix too?

I don't think so, because the . key is popped, if present, just before the equivalent dict comprehension:

props = config.pop('.', None)
kwargs = {k: config[k] for k in config if valid_ident(k)}

@encukou
Copy link
Member

encukou commented Nov 9, 2023

Well, that's how it was in configure_custom too, before this PR.

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good to me.
If the other site needs to be fixed, it can be done in a different PR. Or this one if you prefer :)

@vsajip
Copy link
Member Author

vsajip commented Nov 9, 2023

If the other site needs to be fixed, it can be done in a different PR. Or this one if you prefer :)

I think you're right. Better to make the logic consistent in both places, and it also improves the locality of behavior re. usage of props. Thanks very much for the review!

@vsajip vsajip merged commit a5f29c9 into python:main Nov 9, 2023
@vsajip vsajip deleted the fix-110875 branch November 9, 2023 18:55
@vsajip vsajip added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Nov 9, 2023
@miss-islington-app
Copy link

Thanks @vsajip for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @vsajip for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @vsajip, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a5f29c9faf046b9ef3e498a0bc63dbc29017b5e3 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 9, 2023
…tion c… (pythonGH-110943)

(cherry picked from commit a5f29c9)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
@bedevere-app
Copy link

bedevere-app bot commented Nov 9, 2023

GH-111911 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Nov 9, 2023
vsajip added a commit to vsajip/cpython that referenced this pull request Nov 9, 2023
vsajip added a commit to vsajip/cpython that referenced this pull request Nov 9, 2023
…nfiguration c… (pythonGH-110943).

(cherry picked from commit a5f29c9)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
@bedevere-app
Copy link

bedevere-app bot commented Nov 9, 2023

GH-111914 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Nov 9, 2023
vsajip added a commit that referenced this pull request Nov 9, 2023
…ation c… (GH-110943) (GH-111911)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
vsajip added a commit that referenced this pull request Nov 9, 2023
…ation correctly. (GH-110943) (GH-111914)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.