My wxPython application crashes on opening external files.

Hi everyone!
I compiled my wxPython application using py2exe. It all worked fine.

But when I run it (in Windows), it crashes whenever it tries to open a file

to read data from it or write data to it.

Yet everything works fine when I run the source file with idle.

I would really appreciate it if someone could help me solve this problem.

Thanks in advance!

Guess: PATH problem. py2exe will have a different PATH environment compared to idle.

Michael

···

On Sun, 02 Nov 2014 15:57:11 +0100, <yklearner@gmail.com> wrote:

Hi everyone!
I compiled my wxPython application using py2exe. It all worked fine.
But when I run it (in Windows), it crashes whenever it tries to open a file
to read data from it or write data to it.

Yet everything works fine when I run the source file with idle.
I would really appreciate it if someone could help me solve this problem.

Thanks in advance!

What is the traceback?

How do define the file path?

To debug put some some print statements to see what the path is with running in your development environment (idle - also not recommended to be used with wxPython as it is a Tkinter app which often doesn't play nicely with wxPython) and what it is in your py2exe'd app.

Werner

···

On 11/2/2014 15:57, yklearner@gmail.com wrote:

Hi everyone!
I compiled my wxPython application using py2exe. It all worked fine.
But when I run it (in Windows), it crashes whenever it tries to open a file
to read data from it or write data to it.

Yet everything works fine when I run the source file with idle.
I would really appreciate it if someone could help me solve this problem.

Thanks a lot for sacrificing some of your time to answer me. In fact,
After testing the app on different platforms I’m not quite sure what the

problem really is. So I’m going to do some more testing and debugging

to see if I can state the problem in a clearer way.

Thank you again.

···

Le lundi 3 novembre 2014 08:54:03 UTC, werner a écrit :

On 11/2/2014 15:57, ykle...@gmail.com wrote:

Hi everyone!

I compiled my wxPython application using py2exe. It all worked fine.

But when I run it (in Windows), it crashes whenever it tries to open a
file

to read data from it or write data to it.

Yet everything works fine when I run the source file with idle.

I would really appreciate it if someone could help me solve this problem.

What is the traceback?

How do define the file path?

To debug put some some print statements to see what the path is with
running in your development environment (idle - also not recommended to
be used with wxPython as it is a Tkinter app which often doesn’t play
nicely with wxPython) and what it is in your py2exe’d app.

Werner

My problem is solved. I scanned the wxPython-users archive and noticed some reports about issues caused by the 3.0.0.0 version of wxPython on some Windows platforms. So I uninstalled wxPython3.0.0.0 and tried this: http://wxPython.kosoftworks.com/preview/20140104. With the 3.0.1.0 preview, Now everything works just as I want.

Thanks a lot!

···

Le lundi 3 novembre 2014 23:29:49 UTC, Yao Koffi a écrit :

Thanks a lot for sacrificing some of your time to answer me. In fact,
After testing the app on different platforms I’m not quite sure what the

problem really is. So I’m going to do some more testing and debugging

to see if I can state the problem in a clearer way.

Thank you again.

Le lundi 3 novembre 2014 08:54:03 UTC, werner a écrit :

On 11/2/2014 15:57, ykle...@gmail.com wrote:

Hi everyone!

I compiled my wxPython application using py2exe. It all worked fine.

But when I run it (in Windows), it crashes whenever it tries to open a
file

to read data from it or write data to it.

Yet everything works fine when I run the source file with idle.

I would really appreciate it if someone could help me solve this problem.

What is the traceback?

How do define the file path?

To debug put some some print statements to see what the path is with
running in your development environment (idle - also not recommended to
be used with wxPython as it is a Tkinter app which often doesn’t play
nicely with wxPython) and what it is in your py2exe’d app.

Werner

FYI, 3.0.1 stable is now out. The download page for some reason incorrectly states the current version number, but if you hover over the link you can see it is 3.0.1.1

http://wxpython.org/download.php

···

On Wednesday, November 5, 2014 2:00:41 PM UTC-8, Yao Koffi wrote:

My problem is solved. I scanned the wxPython-users archive and noticed some reports about issues caused by the 3.0.0.0 version of wxPython on some Windows platforms. So I uninstalled wxPython3.0.0.0 and tried this: http://wxPython.kosoftworks.com/preview/20140104. With the 3.0.1.0 preview, Now everything works just as I want.