Crash on pyplot demo

Hi,

I have just installed "wxPython3.0.2.0 " on the latest python2.7.x (python-2.7.9) and then installed the wxPython3.0-win32-docs-demos.exe

to run the demos of WXPython. I tried the pyPlot demo, but this demo crashes with this error message.

python “G:\wxPython3.0 Docs and Demos\demo\PyPlot.py”

Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)]

wx.version: 3.0.2.0 msw (classic)

Traceback (most recent call last):

File “G:\wxPython3.0 Docs and Demos\demo\PyPlot.py”, line 34, in OnButton

win = wx.lib.plot.TestFrame(self, -1, "PlotCanvas Demo")

File “G:\Python64\lib\site-packages\wx-3.0-msw\wx\lib\plot.py”, line 2309, in init

self.client = PlotCanvas(self)

File “G:\Python64\lib\site-packages\wx-3.0-msw\wx\lib\plot.py”, line 599, in init

self.GrabHandCursor = wx.Cursor(GrabHand.GetImage())

File “G:\Python64\lib\site-packages\wx-3.0-msw\wx_gdi.py”, line 1547, in init

_gdi_.Cursor_swiginit(self,_gdi_.new_Cursor(*args, **kwargs))

TypeError: Required argument ‘type’ (pos 2) not found

I wonder if any one can help me to resolve this problem to let this demo work. Or if you know any compatible version between wxpython and python, at least for this demo?

Thanks

Masoud

Hhm, in my copy of 3.0.2 line 599 of plot.py is:
self.GrabHandCursor = wx.CursorFromImage(GrabHand.GetImage())
But I noticed a few other things in the demo which seem to have
slipped in from the Phoenix version of it and need to be changed,
see attached patch.
After these changes the demo works for me on Python 2.7 (32bit) with
3.0.2 classic wxPython on Win8.
Werner

wxLibPlot.patch (1.68 KB)

···

On 4/2/2015 13:10, Masoud Najafi wrote:

Hi,

      I have just installed "wxPython3.0.2.0 "

on the latest python2.7.x (python-2.7.9) and then installed
the wxPython3.0-win32-docs-demos.exe

      to run the demos of WXPython. I tried the

pyPlot demo, but this demo crashes with this error message.

        >python

“G:\wxPython3.0 Docs and Demos\demo\PyPlot.py”

        Python 2.7.9

(default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)]

        wx.version: 3.0.2.0

msw (classic)

        Traceback (most

recent call last):

          File

“G:\wxPython3.0 Docs and Demos\demo\PyPlot.py”, line 34, in
OnButton

            win =

wx.lib.plot.TestFrame(self, -1, “PlotCanvas Demo”)

          File

“G:\Python64\lib\site-packages\wx-3.0-msw\wx\lib\ plot.py”,
line 2309, in init

            self.client =

PlotCanvas(self)

          File

“G:\Python64\lib\site-packages\wx-3.0-msw\wx\lib\ plot.py”,
line 599, in init

self.GrabHandCursor = wx.Cursor(GrabHand.GetImage())

          File

“G:\Python64\lib\site-packages\wx-3.0-msw\wx_gdi. py”,
line 1547, in init

gdi.Cursor_swiginit(self,_ gdi_.new_Cursor(*args,
**kwargs))

        TypeError: Required

argument ‘type’ (pos 2) not found

      I wonder if  any one can help me to

resolve this problem to let this demo work. Or if you know any
compatible version between wxpython and python, at least for
this demo?

Werner wrote:

···

On 4/2/2015 13:10, Masoud Najafi wrote:

Hi,
I have just installed "wxPython3.0.2.0 " on the latest python2.7.x
(python-2.7.9) and then installed the wxPython3.0-win32-docs-demos.exe
to run the demos of WXPython. I tried the pyPlot demo, but this demo
crashes with this error message.

>python "G:\wxPython3.0 Docs and Demos\demo\PyPlot.py"
Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)]
wx.version: 3.0.2.0 msw (classic)
Traceback (most recent call last):
  File "G:\wxPython3.0 Docs and Demos\demo\PyPlot.py", line 34, in
OnButton
    win = wx.lib.plot.TestFrame(self, -1, "PlotCanvas Demo")
  File "G:\Python64\lib\site-packages\wx-3.0-msw\wx\lib\plot.py", line
2309, in __init__
    self.client = PlotCanvas(self)
  File "G:\Python64\lib\site-packages\wx-3.0-msw\wx\lib\plot.py", line
599, in __init__
    self.GrabHandCursor = wx.Cursor(GrabHand.GetImage())
  File "G:\Python64\lib\site-packages\wx-3.0-msw\wx\_gdi.py", line
1547, in __init__
    _gdi_.Cursor_swiginit(self,_gdi_.new_Cursor(*args, **kwargs))
TypeError: Required argument 'type' (pos 2) not found

I wonder if any one can help me to resolve this problem to let this
demo work. Or if you know any compatible version between wxpython and
python, at least for this demo?

Hhm, in my copy of 3.0.2 line 599 of plot.py is:
self.GrabHandCursor = wx.CursorFromImage(GrabHand.GetImage())

But I noticed a few other things in the demo which seem to have slipped
in from the Phoenix version of it and need to be changed, see attached
patch.

After these changes the demo works for me on Python 2.7 (32bit) with
3.0.2 classic wxPython on Win8.

I borrowed the time machine again and fixed those 23 and 9 days ago :wink:

--
Robin Dunn
Software Craftsman

Werner wrote:

...

I borrowed the time machine again and fixed those 23 and 9 days ago :wink:

...
That is unfair;-) :slight_smile:
Werner

···

On 4/4/2015 3:24, Robin Dunn wrote:

So this bug still exists in the wilds of downloadable-installers… the fix seems to be to download and replace the plot.py with the latest (now 10 months old) from git. At least that seems to be working for me. Did I miss any steps, or overlook something that might still be broken?

···

On Friday, April 3, 2015 at 11:58:11 PM UTC-7, werner wrote:

On 4/4/2015 3:24, Robin Dunn wrote:

Werner wrote:

I borrowed the time machine again and fixed those 23 and 9 days ago :wink:

That is unfair;-) :slight_smile:

Werner