Skip to content
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

Deprecate logging.getLevelName(str) #12093

Merged
merged 5 commits into from
Jun 20, 2024
Merged

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Jun 4, 2024

@srittau
Copy link
Collaborator Author

srittau commented Jun 4, 2024

See also #12088 and #12092 for prior discussion.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Jun 4, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/log.py:193: error: Argument "level" to "log" of "Logger" has incompatible type "str"; expected "int"  [arg-type]

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/logging.py:520: error: Argument 1 to "getLevelName" has incompatible type "str"; expected "int"  [arg-type]

mkosi (https://github.com/systemd/mkosi)
+ mkosi/log.py:92:55: error: Argument 1 to "getLevelName" has incompatible type "str"; expected "int"  [arg-type]

@srittau
Copy link
Collaborator Author

srittau commented Jun 4, 2024

Looking at the primer output: mitmproxy uses it in a method that's deprecated itself, pytest's use looks valid, although it could use more explicit code instead, and mkosi's use is unnecessary, as setLevel accepts str levels.

Copy link
Contributor

github-actions bot commented Jun 4, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit dc504f5 into python:main Jun 20, 2024
63 checks passed
@srittau srittau deleted the get-level-name branch June 20, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants