From: Neal B. <ndb...@gm...> - 2012-07-18 12:07:23
|
One annoyance with mpl in the past is that when running a script, SIGINT would not kill it (needed to use C-c C-\ instead). It seems this is now fixed: Interrupt now gives me: File "/home/nbecker/.local/lib/python2.7/site- packages/matplotlib/backends/backend_gtk.py", line 77, in mainloop gtk.main() KeyboardInterrupt |
From: Phil E. <pel...@gm...> - 2012-07-18 18:28:15
|
Presumably you mean on the qt4 backend? If so, glad to be of some help! :-) The change came in in PR #851 (https://github.com/matplotlib/matplotlib/pull/851/files#diff-7) and also allows you to close a figure with ctrl+w and make a qt4 figure fullscreen with "ctrl+f" (actually, just "f" will do, but I have an ambition to nuke the non-controled versions by default). UPDATE: I've just noticed that your traceback is showing your backend as gtk, for which I cannot take any credit (nor do I know the change which caused this improvement). On 18 July 2012 13:06, Neal Becker <ndb...@gm...> wrote: > One annoyance with mpl in the past is that when running a script, SIGINT would > not kill it (needed to use C-c C-\ instead). > > It seems this is now fixed: > > Interrupt now gives me: > > File "/home/nbecker/.local/lib/python2.7/site- > packages/matplotlib/backends/backend_gtk.py", line 77, in mainloop > gtk.main() > KeyboardInterrupt > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |
From: Neal B. <ndb...@gm...> - 2012-07-18 18:40:56
|
OK, my mistake. I'm using 1.1.1rc2. I was using a new installation without any matplotlibrc, and was defaulted to gtk. If I set: backend : Qt4Agg then the problem has returned. Phil Elson wrote: > Presumably you mean on the qt4 backend? If so, glad to be of some help! :-) > > The change came in in PR #851 > (https://github.com/matplotlib/matplotlib/pull/851/files#diff-7) and > also allows you to close a figure with ctrl+w and make a qt4 figure > fullscreen with "ctrl+f" (actually, just "f" will do, but I have an > ambition to nuke the non-controled versions by default). > > > UPDATE: I've just noticed that your traceback is showing your backend > as gtk, for which I cannot take any credit (nor do I know the change > which caused this improvement). > > > > On 18 July 2012 13:06, Neal Becker > <ndb...@gm...> wrote: >> One annoyance with mpl in the past is that when running a script, SIGINT >> would not kill it (needed to use C-c C-\ instead). >> >> It seems this is now fixed: >> >> Interrupt now gives me: >> >> File "/home/nbecker/.local/lib/python2.7/site- >> packages/matplotlib/backends/backend_gtk.py", line 77, in mainloop >> gtk.main() >> KeyboardInterrupt >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ |
From: Benjamin R. <ben...@ou...> - 2012-07-18 19:00:33
|
On Wed, Jul 18, 2012 at 1:40 PM, Neal Becker <ndb...@gm...> wrote: > OK, my mistake. I'm using 1.1.1rc2. > > I was using a new installation without any matplotlibrc, and was defaulted > to > gtk. > > If I set: > backend : Qt4Agg > > then the problem has returned. > > Usually, the source of such problems is someone using a bare try...except. KeyboardInterrupt subclasses BaseException. There is a subtle difference between try: foo() except: pass and try: foo() except Exception: pass The first will capture Ctrl-C and throw it away, while the latter will not. PEP8 recommends against blind usage of bare except clauses. Happy hunting! Ben Root |
From: Phil E. <pel...@gm...> - 2012-07-18 19:30:45
|
Ben, actually the PyQt4 backend is responsible for this (a hello world pyqt4 application doesn't accept sigint). However, I have fixed master (in the aforementioned PR) so that ctrl+c from the command line actually closes the figure. HTH, On 18 July 2012 20:00, Benjamin Root <ben...@ou...> wrote: > > > On Wed, Jul 18, 2012 at 1:40 PM, Neal Becker <ndb...@gm...> wrote: >> >> OK, my mistake. I'm using 1.1.1rc2. >> >> I was using a new installation without any matplotlibrc, and was defaulted >> to >> gtk. >> >> If I set: >> backend : Qt4Agg >> >> then the problem has returned. >> > > Usually, the source of such problems is someone using a bare try...except. > KeyboardInterrupt subclasses BaseException. There is a subtle difference > between > > try: > foo() > except: > pass > > and > > try: > foo() > except Exception: > pass > > The first will capture Ctrl-C and throw it away, while the latter will not. > PEP8 recommends against blind usage of bare except clauses. > > Happy hunting! > Ben Root > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > |
From: Neal B. <ndb...@gm...> - 2012-07-18 19:28:24
|
I'm afraid it's only an annoyance, and I doubt I'll be motivate to try to hunt that down. Benjamin Root wrote: > On Wed, Jul 18, 2012 at 1:40 PM, Neal Becker > <ndb...@gm...> wrote: > >> OK, my mistake. I'm using 1.1.1rc2. >> >> I was using a new installation without any matplotlibrc, and was defaulted >> to >> gtk. >> >> If I set: >> backend : Qt4Agg >> >> then the problem has returned. >> >> > Usually, the source of such problems is someone using a bare try...except. > KeyboardInterrupt subclasses BaseException. There is a subtle difference > between > > try: > foo() > except: > pass > > and > > try: > foo() > except Exception: > pass > > The first will capture Ctrl-C and throw it away, while the latter will > not. PEP8 recommends against blind usage of bare except clauses. > > Happy hunting! > Ben Root |