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

Matplotlib Gtk backend is broken in Python consoles #2471

Closed
anderwm opened this issue Jun 5, 2015 · 15 comments
Closed

Matplotlib Gtk backend is broken in Python consoles #2471

anderwm opened this issue Jun 5, 2015 · 15 comments

Comments

@anderwm
Copy link

anderwm commented Jun 5, 2015

Starting with 10312, the standard console starts with warning :
(process:4958): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Pressing enter gets me the prompt, but none of my keystrokes appear. Also, there is no option for Ipython console (which was available before 10312). Am I the only one seeing these kinds of problems? I am on Ubuntu 15.04

@ccordoba12
Copy link
Member

There's no revision 10311, I mean that doesn't correspond to any git hash. Please report the right revision.

Besides, master has moved to support only IPython version 3 or higher. That's probably the reason you're not seeing it.

@anderwm
Copy link
Author

anderwm commented Jun 5, 2015

Sorry Carlos, I still use mercurial on my machine and pull with hg-git, I forgot the revision numbers are all changed.
You are right, it is the master branch that presents my issue. I understand the IPython version restriction, but the python console still seems like a bug. Or at least some dependence that has changed from the 2.3 branch. The console is not usable, as it seems the keystrokes are hijacked. If your not ready for this kind of feedback yet on master branch I understand that and will continue using 2.3.

@anderwm anderwm changed the title Consoles broken in everything after revision 10311 Internal console keystrokes lost in master branch Jun 5, 2015
@anderwm
Copy link
Author

anderwm commented Jun 5, 2015

The Locale not supported warning isn't related and begins on Merge pull request #2349 from goanpeca/language: Add support for language selection in preferences
commit 79242c4

The console problem begins with
Python Console: Fix plotting with the Qt4 backend
Fixes #2231
commit 6bbd031

@anderwm anderwm changed the title Internal console keystrokes lost in master branch Python console keystrokes lost in master branch Jun 5, 2015
@goanpeca
Copy link
Member

goanpeca commented Jun 5, 2015

Hmm, ok I will take a look

@ccordoba12
Copy link
Member

@goanpeca, the problem is en is not recognized as a valid locale. I think you need to set as a default en_US. See this post for more info:

http://askubuntu.com/questions/359753/gtk-warning-locale-not-supported-by-c-library-when-starting-apps-from-th

@ccordoba12
Copy link
Member

And according to @anderwm, the problem is in the Python console, with the GtkAgg mpl backend

@ccordoba12 ccordoba12 added this to the v3.0 milestone Jun 5, 2015
@anderwm
Copy link
Author

anderwm commented Jun 5, 2015

I now believe it is 2 unrelated issues. The warning from goanpeca/language goes away before his merge, but the python console problem remains until before commit 6bbd031

@ccordoba12
Copy link
Member

Ok, thanks. I'll take care of the second problem then :-)

@goanpeca
Copy link
Member

goanpeca commented Jun 5, 2015

I was aware of the warning, but it seem harmless so I ignored it 😸, but I can make a fix to get rid of it.

@ccordoba12
Copy link
Member

@goanpeca, please do :-) This is too visible and so something please will keep complaining about.

@goanpeca
Copy link
Member

@ccordoba12 for the language fix there are two ways...

1.) Either rename the locale folders to valid names... (and from now on make sure translations are places in a correctly named directory) or

2.) to make a mapping inside baseconfig so that when en is loaded it turns to en_US.

The first one would make it more future proof so I would prefer that one... but the gettext script would have to be changed as well. The second one is easier to implement but would become too hacky eventually...

Let me know

@ccordoba12 ccordoba12 changed the title Python console keystrokes lost in master branch Matplotlib Gtk backend is broken in Python consoles Jul 12, 2015
@ccordoba12 ccordoba12 self-assigned this Jul 12, 2015
@ccordoba12
Copy link
Member

I'm sorry but I'm going to remove support for the Gtk backend in our Python Consoles for Spyder 3. You can still use it without problems in our IPython consoles :-)

I tried to make it work for several hours this weekend and couldn't do it. It seems to be caused by a tricky interaction between Qt and Gtk event loops.

Since this backend doesn't provide any additional functionality over the Qt or Tkinter ones (which are working as expected), then I don't see the need to spend more time trying to support it.

@anderwm
Copy link
Author

anderwm commented Jul 15, 2015

I may be missing something as I don't fully understand how all the backend systems hook in. However, I am using Qt4Agg as the matplotlib backend as selected in console settings under preferences. I am not sure how we got onto gtk, except that was the warning message for the locale problem. As far as I can tell the lost keystroke problem is not GTK specific.

@anderwm
Copy link
Author

anderwm commented Jul 15, 2015

The problem I was having was resolved, according to bisect:

The first good revision is:
changeset: fbd66cb
user: Carlos Cordoba ccordoba12@gmail.com
date: Sun Jul 12 10:19:33 2015 -0500
summary: Python Console: Fix crash after first execution

@ccordoba12
Copy link
Member

@anderwm, sorry, I thought you were using the GtkAgg backend because of the Gtk error message you also reported. But I'm glad to hear the error is fixed for you now ;-)

I already referenced this issue from a commit that I'm about to push, so let's leave it like this in case someone else looks for us dropping GtkAgg in the future :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants