-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix logging level type #10734
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
Fix logging level type #10734
Conversation
What is the minimal code that triggers the error? |
And what are the contents of your matplotlibrc file? I suspect your file is out of date and maybe you need to change the rcparam? |
The minimal code that triggers the error for me is |
OK, well,
returns integers: and all works as expected. Is it possibly an issue with python 3.4? I can't find the python 3.4 logging documentation on-line, but its possible that old versions of Python 2.1.2 did logging an entirely different way. EDIT: OK https://docs.python.org/3.4/library/logging.html and indeed the meaning of |
Python 3.4.1. Installed with |
You have the one version of python that this won't work on... @tacaswell @dopplershift @efiring whats the policy here? We could fix |
I'm evidently missing something, because I don't see why the PR isn't correct--it looks right to me. And using "logging.DEBUG" as the argument makes sense to me, especially since it looks like the kwarg is never used with other than its default value, and |
@efiring that'd fine if no one else is using the private API. Given the number of people who tend to use our private API, I was hesitant to change the call signature of |
We could put in a check that it is not python 3.4.1 and try to do the log look if the input is a string, but as @efiring says this is a private method. I think this fix is fine bit a bit moot on master where we have dropped support for 3.4. |
I'm fine with the change. But for some reason suddenly leery about API changes, even ones considered private 😉 |
I did want to figure out why this was breaking, because its not like Matplotlib is so poorly tested no one had run |
👍 on running exactly what was going on to ground! |
Thanks @gregorybchris ! |
Backport PR #10734 on branch v2.2.x
+1 This was a huge blockade for our team, really happy to have this integrated in. Thank you @gregorybchris!! |
Fair warning: MPL 3.0 will no longer actively support python 3.4. I think anyone who got caught by this bug is on either on 3.4.0 or 3.4.1. |
PR Summary
When importing matplotlib version 2.2.0 a TypeError is raised (see trace below) upon initialization. This is caused by a string being passed as the
level
parameter to the standard python logger functionlog()
when it should be an integer.The fix was to change the contract of the
_wrap()
function so that the default value of thelevel
parameter islogger.debug
and not'DEBUG'
.PR Checklist