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
rcParams.keys() is not Python 3 compatible #1721
Conversation
The transformation you quote should already have been performed by |
I agree that 2to3 should do this but it doesn't. You can test that easily by running So this seems to be a deficiency in For the time being I guess we need a manual fix. What is your opinion? |
There are no Travis failures indicating errors of this kind, so I am curious as to why you get this error. How does the error arise? Do you get it right after |
Addendum: AFAIK, Travis runs 2to3 on the whole source tree. |
Generally, matplotlib in Python 3 works fine. I got this error while trying to modify |
Has your ipython been built with python 3? |
Yes, it has. This issue does not have anything to do with ipython, I just happened to notice it there first. Steps to reproduce this with plain
|
Interesting -- I see this now -- 2to3 does do this:
But leaves this alone (perhaps because there is an argument to keys here).
I'll go ahead and attach a commit with the change you recommended. |
rcParams.keys() is not Python 3 compatible
When I run rcParams.keys() in Python 3 I get the following exception:
AttributeError: 'dict_keys' object has no attribute 'sort'
This is due to the fact that the keys method does not return a list but a dict_keys object, which has no sort method.
To retain the behavior from Python 2 I suggest the following patch:
This works fine in Python 2 and 3.
For completeness, I used Python 3.2.3 and matplotlib 1.2.0 from Debian unstable/experimental.
Thanks for the great work.