Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
MAINT: don't format logs in log call.#25073
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
In particular f-string:There are many reason not to use f-string in logs, - F-strings are eager, so might be slow. So this may affect performance (we can filter before formatting). - prevent structured logging or handler to highlight. - Security (untrusted input can lead to DOS on formatting,https://discuss.python.org/t/safer-logging-methods-for-f-strings-and-new-style-formatting/13802)But also % formatting in a couple of places.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
story645 commentedJan 25, 2023
Can a note about this be put somewhere on thecontributing code page? I worry that this is the type of thing that will get changed in either direction 16 times. |
jklymak commentedJan 25, 2023
@meeseeksdev backport to 3.7.0 |
Something went wrong ... Please have a look at my logs. It seems that the branch you are trying to backport to does not exist. |
jklymak commentedJan 25, 2023
@meeseeksdev backport to 3.7.x |
Something went wrong ... Please have a look at my logs. It seems that the branch you are trying to backport to does not exist. |
jklymak commentedJan 25, 2023
@meeseeksdev backport to v3.7.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free tosuggest an improvement. |
jklymak commentedJan 25, 2023
@Carreau is this important enough to manually backport? |
ksunden commentedJan 25, 2023
I didn't go back to find these lines specifically, but most of these are likely made into f strings via#24980 which was not itself backported to 3.7.x |
jklymak commentedJan 25, 2023
Ah.... It did all seem too obscure to have triggered conflicts. So I think this can safely not be backported. |
greglucas commentedJan 25, 2023
This may conflict with the f-string PR, but that PR only changed from |
tacaswell commentedJan 25, 2023
Given it was non ideal before (and probably has been for a while) I do not think backporting is a high-priority. |
Carreau commentedJan 25, 2023
I agree it's not critical to backport. It can be put on the style guide, there is also a pylint item that detect some of those usage. Mostly it's giving the right example, so it has more chances of not being copy/pasted somewhere else. |
Uh oh!
There was an error while loading.Please reload this page.
In particular f-string:
There are many reason not to use f-string in logs,
But also % formatting in a couple of places.
PR Checklist
Documentation and Tests
pytestpasses)Release Notes
.. versionadded::directive in the docstring and documented indoc/users/next_whats_new/.. versionchanged::directive in the docstring and documented indoc/api/next_api_changes/next_whats_new/README.rstornext_api_changes/README.rst