Python crashes with 3.0.0

Hi, ALL,
I have a Windows XP SP3 32-bit OS with python-2.7.
I just upgraded my wxPython here from 2.9.4 to 3.0.0 in order to test some bugs.

Surprisingly adding the following:

self.locale = wx.Locale(wx.LANGUAGE_DEFAULT)

to my app constructor crashes python.

I tried adding this line to DatePickerCtrl.py demo file and it crashed
there as well.

What am I missing?

I just removed the old wxPython + demo/samples installation thru the
Control Panel and installed 3.0.0 version from the binaries.

Thank you.

Some other users had had problems with WinXP and wxPython 3.0.0. Have you tried 3.0.1 (see below, unfortunately Robin Dunn seems to wait for a new release until wxwidgets 3.0.1 comes out)? I personally switched back to 2.9.5 (but was able to confirm that updating to the unofficial 3.0.1 solveb my XP problems). BTW, wxPython (Phoenix) also did, but many things are still missing, so it was no option for me.

https://groups.google.com/forum/#!searchin/wxpython-users/3.0.1/wxpython-users/DCWJ_klDnIA/zcHqZDaYMekJ

Hi,

···

On 4/22/2014 12:59, nepix32 wrote:

Some other users had had problems with WinXP and wxPython 3.0.0. Have you tried 3.0.1 (see below, unfortunately Robin Dunn seems to wait for a new release until wxwidgets 3.0.1 comes out)? I personally switched back to 2.9.5 (but was able to confirm that updating to the unofficial 3.0.1 solveb my XP problems). BTW, wxPython (Phoenix) also did, but many things are still missing, so it was no option for me.

What was missing for you? Maybe it helps to get things moved up the priority list if you mention it here on the dev list.

Werner

ummm, well… simply put,
The wx30 build that Robin put out initially did appear to work first off,
BUT,
there was numerous problems running applications that used certain widgets(especially the official demo),
and what this basically boiled down to was that
there was some new never before seen compiling issues that had happened that only affected MSWindows users.
These where worse for XP than vista, 7, 8, etc…, but none the less…
If it doesn’t work right on XP, then of course everything else didn’t also like a stack of MSDominoes.

I can confirm that I have since been using the preview builds found here atm
Index of /preview/20140104

wx 3.0.1.0.b20140104 that all the problems have since been fixed. It came out about a week after what most folks get from the Main page.

The story in short was that Robin was wanting to push out a RELz for Christmas 2013(December 25th) basically,
but only it was right up until the end that about christmas eve that the problems with the build was really
first stumbled upon(with another previous preview build actually),
and by that time it was a bit too late to fix. as the Merry Christmas commit had already was upon everyones feet.
It wasn’t until about a week later that it got a quick fix preview build on the 4th of January 2014.

Since then I have used the build and tested it completely, on XP and above,
as many other users migrating to the new quote wx"3.0" also have.
YES, it does work, the fact is that Robins main page hasn’t been updated since.

We all realize that Robin is a very busy fellow and that everything takes time and testing,
but at this point, I can tell you that just about 98% of folks that have even meantioned similar
problems with the original builds for wx3.0 had their upgrading problems almost magically fixed
by just upgrading to the 3.0.1.0.b20140104.

Point in case. It is April now. I have been running SourceCoder from that builds page on every MSWindows(including 2000), various Linus and Snow leopard(Mac)
since. The thing we need to do is get Robin to find the time to update the main page with the preview builds also for MSWindows at the very least
or push for fim to make a quicker “next” release.

So, yes, I urg you to uninstall the wx3.0 build you might have installed and reinstall the similar one from the preview builds page.
It really does work!!!, even tho it hasn’t made it’s way to the main page yet.

I knew I would regret the decision to give Phoenix a try again (on 2.7). Phoenix works quite well for standard things, but quite a lot has changed, so it takes some time to get things to work.

My app (closed source, plotting) depends (mainly) on matplotlib and its wx backend.

I set up a virtualenv and tried to get it work. Amazingly the installation with pip and the Phoenix wheel (wxPython_Phoenix-3.0.1.dev76380-cp27-none-win32.whl) worked quite well.

These were the stumbling blocks for me (in that order):

  • No module named wx.calendar: It took some time to re-discover where all the modules/objects had gone

#import wx.calendar as wc
from wx.lib.agw.persist.persist_handlers import PyDate2wxDate, wxDate2PyDate

wx.DatePickerCtrl and its events

from wx.adv import DatePickerCtrl, DP_DROPDOWN, DP_SHOWCENTURY, DP_ALLOWNONE
from wx.adv import EVT_DATE_CHANGED

  • Clone no longer required for self-defined PyCommandEvents

  • wx.ListCtrl

InsertItem instead of InsertStringItem

SetItem instead of SetStringItem

  • DragDrop:

PyTextDataObject deprecated

Changing to TextDataObject the DropTarget.GetData() gives only an empty string (UNRESOLVED)

  • matplotlib 1.3.1 related issues (I have seen you, werner, to be on github/matplotlib regarding Phoenix, but did not see what the outcome has been)

wxversion required by backend_wx, but does not exist (my Hack: remove wxversion from matplotlib in virtualenv)

Some constants in matplotlib wx backend are no longer defined (commented them out)

…\backend_wx.py", line 923, in gui_
repaint
drawDC.BeginDrawing()
AttributeError: ‘PaintDC’ object has no attribute ‘BeginDrawing’

Here I then gave up on it because I am perfectly fine with 2.9.5, where everything works nice

Appreciate that some things are more concise in wxPython (Phoenix), e. g. the SetItem instead of the SetStringItem for the ListCtrl

Will have a look in the drag/drop issue later on.

With best regards

···

On Tuesday, April 22, 2014 1:38:59 PM UTC+2, werner wrote:

wxPython 3.0.1 (Phoenix)
What was missing for you? Maybe it helps to get things moved up the
priority list if you mention it here on the dev list.

Yes, moving from wxPython classic to Phoenix is some work. Reading
the following that works needs to be done to explain in more detail
what the changes are in more detail then what is there at this
point.

even after changing to TextDataObject?
Just checked, they flagged it to add it only for 1.4, I tried to
convince them to do it now as it the way the patch is done it should
have not effect on wxPython classic users. It might help if people
started to ask on the matplotlib list for support of
wxPython-Phoenix and PR 2803 would help for that.
just Remove BeginDrawing and EndDrawing or have them conditional for
Classic with code like:
if not ‘phoenix’ in wx.PlatformInfo:
see also:
Werner

···

Hi,

  On 4/23/2014 14:01, nepix32 wrote:
    On Tuesday, April 22, 2014 1:38:59 PM UTC+2, werner wrote:
      wxPython

3.0.1 (Phoenix)

      What was missing for you?  Maybe it helps to get things moved

up the

      priority list if you mention it here on the dev list.
      I knew I would regret the decision to give Phoenix a try

again (on 2.7). Phoenix works quite well for standard things,
but quite a lot has changed, so it takes some time to get
things to work.

  • DragDrop:

PyTextDataObject deprecated

      Changing to TextDataObject the DropTarget.GetData() gives

only an empty string (UNRESOLVED)

      * matplotlib 1.3.1 related issues (I have seen you, werner,

to be on github/matplotlib regarding Phoenix, but did not see
what the outcome has been)

      wxversion required by backend_wx, but does not exist (my

Hack: remove wxversion from matplotlib in virtualenv)

      Some constants in matplotlib wx backend are no longer

defined (commented them out)

…\backend_wx.py", line 923, in gui_

      repaint

          drawDC.BeginDrawing()

      AttributeError: 'PaintDC' object has no attribute

‘BeginDrawing’

      Here I then gave up on it because I am perfectly fine with

2.9.5, where everything works nice

http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html

[PyTextDataObject deprecated]

      Changing to TextDataObject the DropTarget.GetData() gives

only an empty string (UNRESOLVED)

even after changing to TextDataObject?

I have to build a small sample to show what happens.

      * matplotlib 1.3.1 related issues (I have seen you, werner,

to be on github/matplotlib regarding Phoenix, but did not see
what the outcome has been)

      wxversion required by backend_wx, but does not exist (my

Hack: remove wxversion from matplotlib in virtualenv)

Yes, I remember now (PR 2803).

I still wonder why your pull request 2803 for matplotlib works without having wxversion installed (if you look in the wxPython .whl, it is not there)

      Some constants in matplotlib wx backend are no longer

defined (commented them out)

Just checked, they flagged it to add it only for 1.4, I tried to

convince them to do it now as it the way the patch is done it should
have not effect on wxPython classic users. It might help if people
started to ask on the matplotlib list for support of
wxPython-Phoenix and PR 2803 would help for that.

I commented on #2803, maybe the compat layer would be useful?

There are still lurking issues, e.g. the matplotlib draggable legend disappears when dragging, but the app works using Phoenix.

Thanks for bringing some light into this!

With best regards,

···

On Wednesday, April 23, 2014 2:29:48 PM UTC+2, werner wrote:

Hi, guys,
I have a quick question.

I did an uninstall of 2.9.4 from Control Panel -> Add/Remove Program.
Is it proper way? Maybe something is left after removal and there is a
conflict with new installation...

Thank you.

···

On Wed, Apr 23, 2014 at 9:23 AM, nepix32 <nepix32@gmail.com> wrote:

On Wednesday, April 23, 2014 2:29:48 PM UTC+2, werner wrote:

[PyTextDataObject deprecated]

Changing to TextDataObject the DropTarget.GetData() gives only an empty
string (UNRESOLVED)

even after changing to TextDataObject?

I have to build a small sample to show what happens.

* matplotlib 1.3.1 related issues (I have seen you, werner, to be on
github/matplotlib regarding Phoenix, but did not see what the outcome has
been)
wxversion required by backend_wx, but does not exist (my Hack: remove
wxversion from matplotlib in virtualenv)

Yes, I remember now (PR 2803).
I still wonder why your pull request 2803 for matplotlib works without
having wxversion installed (if you look in the wxPython .whl, it is not
there)

Some constants in matplotlib wx backend are no longer defined (commented
them out)

Just checked, they flagged it to add it only for 1.4, I tried to convince
them to do it now as it the way the patch is done it should have not effect
on wxPython classic users. It might help if people started to ask on the
matplotlib list for support of wxPython-Phoenix and PR 2803 would help for
that.

I commented on #2803, maybe the compat layer would be useful?
There are still lurking issues, e.g. the matplotlib draggable legend
disappears when dragging, but the app works using Phoenix.

Thanks for bringing some light into this!

With best regards,

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

… When I did that work wxPython the wheels did not exist and my
install had a wxversion - so that needs additional work.
Werner

···

Hi,

  On 4/23/2014 18:23, nepix32 wrote:
      On Wednesday, April 23, 2014 2:29:48 PM UTC+2, werner wrote:
              * matplotlib 1.3.1 related issues (I have seen you,

werner, to be on github/matplotlib regarding Phoenix,
but did not see what the outcome has been)

              wxversion required by backend_wx, but does not

exist (my Hack: remove wxversion from matplotlib in
virtualenv)

Yes, I remember now (PR 2803).

      I still wonder why your pull request 2803 for matplotlib works

without having wxversion installed (if you look in the
wxPython .whl, it is not there)

Hi,

...

* matplotlib 1.3.1 related issues (I have seen you, werner, to be on
github/matplotlib regarding Phoenix, but did not see what the outcome has
been)
wxversion required by backend_wx, but does not exist (my Hack: remove
wxversion from matplotlib in virtualenv)

Yes, I remember now (PR 2803).
I still wonder why your pull request 2803 for matplotlib works without
having wxversion installed (if you look in the wxPython .whl, it is not
there)

When I did that work wxPython the wheels did not exist and my install had a
wxversion - so that needs additional work.

The interesting thing is:
I successfully was using winpdb to debug my apps, and now its crashing
somewhere in
the wx.App constructor.

I will try to install the dev release of wxPython mentioned above.

Thank you.

···

On Wed, Apr 23, 2014 at 1:27 PM, Werner <wernerfbd@gmx.ch> wrote:

On 4/23/2014 18:23, nepix32 wrote:
On Wednesday, April 23, 2014 2:29:48 PM UTC+2, werner wrote:

Werner

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Werner wrote:

even after changing to TextDataObject?

This is a known issue.

…\backend_wx.py", line 923, in gui_

      repaint

          drawDC.BeginDrawing()

      AttributeError: 'PaintDC' object has no attribute

‘BeginDrawing’

      Here I then gave up on it because I am perfectly fine with

2.9.5, where everything works nice

just Remove BeginDrawing and EndDrawing or have them conditional for

Classic with code like:

if not 'phoenix' in wx.PlatformInfo:

BeginDrawing and EndDrawing have been empty stub functions in the C++ code for as long as I can remember. They were probably there due to a “premature optimization” when somebody thought that maybe some platform might have something that should be done before and after drawing… Anyway, calls to those methods can be removed in any version of wxPython
with no effect.

···

Hi,

  On 4/23/2014 14:01, nepix32 wrote:

  • DragDrop:

PyTextDataObject deprecated

      Changing to TextDataObject the DropTarget.GetData() gives

only an empty string (UNRESOLVED)


Robin Dunn

Software Craftsman

http://wxPython.org

In other words…
…You can just delete or comment out the BeginDrawing/EndDrawing lines if need be without working around them…

When upgrading to phoenix, simply, just make sure you can run classic 3.0 first then, just bit by bit work your code to work with the changes layed out(and improved everyday) here. http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html

But, yes it does take a small bit of work to upgrade from classic to phoenix.
I myself happened to do this, in the course of initial phoenix development, so no, it isn’t impossible, but in my eyes more rather a TODO item for most folks.

It is not hard, just takes a bit of side-track time to earn what has changed.
Cross-Py2-Py3- Classic/Phoenix code is entirely possible in this transition process.
Just take your time transitioning…,
…we have tried to make it as easy as possible, but a bit of learning IS required in doing so.

The HEAD of the new updated docs can be found here.
http://wxpython.org/Phoenix/docs/html/index.html