IDLE hangs despite -n

Hm. Done that. A figure window pops up immediately but is

    > not being updated correctly: a part of the graph is visible,
    > the other part of the figure (which was underneath another
    > window initially) appears white. The titel of the figure
    > says "Figure 1 (Not responding)". IDLE, however, responds
    > happily :wink: T

Todd, many moons ago you wrote me and said I had inadvertently screwed
up something in tkagg show that broke the idle -n behavior. If I
recall correctly, we never reverted, since I didn't understand exactly
what to do. Perhaps you could revisit the current tkagg versus the
old one to make sure it is right.

Hans, does it make a difference if you uncomment

    #os.environ['PYTHONINSPECT'] = '1'

in the show method of
site-packages/matplotlib/backends/backend_tkagg.py? You should set
'interactive : True' as Todd suggested. Do not use show, as it is not
designed for interactive use. I suggest carefully testing all 4
combinations: with and without the PYTHONINSPECTmline, and with and
without -n. As you probably know, you'll need to restart idle after
every change to the module source code, or at least reload the module
if you know how to do that.

Some bugs refuse to die. Let us know...

    > I take it there is no more recent version of matplotlib for
    > windows (and Python 2.3) than 0.70.1?

That's the latest.

Good luck!
JDH

John,

   > Hm. Done that. A figure window pops up immediately but is
   > not being updated correctly: a part of the graph is visible,
   > the other part of the figure (which was underneath another
   > window initially) appears white. The titel of the figure
   > says "Figure 1 (Not responding)". IDLE, however, responds
   > happily :wink: T

Todd, many moons ago you wrote me and said I had inadvertently screwed
up something in tkagg show that broke the idle -n behavior. If I
recall correctly, we never reverted, since I didn't understand exactly
what to do. Perhaps you could revisit the current tkagg versus the
old one to make sure it is right.

Hans, does it make a difference if you uncomment

   #os.environ['PYTHONINSPECT'] = '1'

in the show method of
site-packages/matplotlib/backends/backend_tkagg.py? You should set
'interactive : True' as Todd suggested. Do not use show, as it is not
designed for interactive use. I suggest carefully testing all 4
combinations: with and without the PYTHONINSPECTmline, and with and
without -n.

Setting 'interactive=True' in .matplotlibrc

IDLE #os.environ['PYTHONINSPECT'] = '1' -> fail
IDLE -n #os.environ['PYTHONINSPECT'] = '1' -> fail
IDLE os.environ['PYTHONINSPECT'] = '1' -> fail
IDLE -n os.environ['PYTHONINSPECT'] = '1' -> success

So that's good. However, notice that also

setting 'interactive=False'

IDLE os.environ['PYTHONINSPECT'] = '1'

seems to work! (Which is what I wanted initially and what didn't work.)

So from my naive perspective the line "environ['PYTHONINSPECT'] = '1' " should not be commented.

Thanks for you help -- hope this is useful,

Hans

Hi John,

I am coming back to our earlier discussion ...

Hm. Done that. A figure window pops up immediately but is
not being updated correctly: a part of the graph is visible,
the other part of the figure (which was underneath another
window initially) appears white. The titel of the figure
says "Figure 1 (Not responding)". IDLE, however, responds
happily :wink: T

Todd, many moons ago you wrote me and said I had inadvertently screwed
up something in tkagg show that broke the idle -n behavior. If I
recall correctly, we never reverted, since I didn't understand exactly
what to do. Perhaps you could revisit the current tkagg versus the
old one to make sure it is right.

Hans, does it make a difference if you uncomment

#os.environ['PYTHONINSPECT'] = '1'

in the show method of
site-packages/matplotlib/backends/backend_tkagg.py? You should set
'interactive : True' as Todd suggested. Do not use show, as it is not
designed for interactive use. I suggest carefully testing all 4
combinations: with and without the PYTHONINSPECTmline, and with and
without -n.

Setting 'interactive=True' in .matplotlibrc

IDLE #os.environ['PYTHONINSPECT'] = '1' -> fail
IDLE -n #os.environ['PYTHONINSPECT'] = '1' -> fail
IDLE os.environ['PYTHONINSPECT'] = '1' -> fail
IDLE -n os.environ['PYTHONINSPECT'] = '1' -> success

So that's good.

This doesn't work in non-interactive mode. What I observe is this:

- start Idle with -n (the "==== No Subprocess ====" message appears).
- at prompt issue commands:

import pylab
pylab.plot(range(10))
pylab.show()

- figure windows shows up
- python reports this error message:

pylab.show()

Exception in Tkinter callback
Traceback (most recent call last):
   File "C:\Python23\lib\lib-tk\Tkinter.py", line 1345, in __call__
     return self.func(*args)
   File "C:\Python23\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 215, in key_release
     FigureCanvasBase.key_release_event(self, key)
   File "C:\Python23\Lib\site-packages\matplotlib\backend_bases.py",
line 677, in key_release_event
     event = KeyEvent('key_release_event', self, key, self._lastx, self._lasty)
   File "C:\Python23\Lib\site-packages\matplotlib\backend_bases.py",
line 640, in __init__
     LocationEvent.__init__(self, name, canvas, x, y)
   File "C:\Python23\Lib\site-packages\matplotlib\backend_bases.py",
line 566, in __init__
     if a.in_axes(self.x, self.y):
   File "C:\Python23\Lib\site-packages\matplotlib\axes.py", line 1544, in in_axes
     return self.bbox.contains(xwin, ywin)
TypeError: float() argument must be a string or a number

The figure windows is interacting (despite the error message). Once I close the figure window, I can't get back to the Python prompt; i.e. the shell doesn't respond any more.

Do we expect matplotlib (0.70.1) to work in non-interactive mode with "IDLE -n"?

Thanks,

Hans