[wxPython-users] Re: Platform<=>version conflict or what?

Werner F. Bruhin werner.bruhin at free.fr
Mon May 14 02:28:02 PDT 2007


Hi Jorma,

Jorma Paavola wrote:
> ...
> Hi Werner,
>
> I 'compiled'this sw into .exe-file with Py2exe and ran it by 
> "double-clicking":
>
> 1) in Win2k - PC (python sw´s installed)==> Running OK, when started 
> by double-click(as before) !
>
> 2) in 'clean' Win 98 - PC (no python sw´s installed) ==> Unfortunately 
> generates Traceback:
>> Traceback (most recent call last):
>>   File "Morow.py", line 49, in <module>
>>   File "Morow.py", line 15, in create
>>   File "Morow.py", line 25, in __init__
>>   File "Morow.py", line 41, in MyGcCollect
>>   File "wx\_windows.pyo", line 2928, in __init__
>> wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at 
>> ..\..\src\msw\control.cpp(159) in wxControl::MSWCreateControl(): 
>> CreateWindowEx("msctls_progress32", flags=52000000, ex=00000200) failed
> NOTE: Original TestSW (without GcCollect) could not create any 
> wxWindowClassNR !
Are you saying with gc.collect it now can create some?  If yes, then you 
need to put more calls do gc.collect.

I assume you changed this:

if runningPlatform[0] == 6: # Testaa onko Windows 9x
to something like this:
if runningPlatform[0] < 4: # Testaa onko Windows 9x

I am not sure what the version number for WinMe and/or 9x, but I think 
if you use " <4" you should catch anything before Win NT.
>
> 3) Original TestSW (without GcCollect) generates Tracebacks:
> on 'clean' WinMe PC:
>> Traceback (most recent call last):
>>   File "Moro.py", line 1, in <module>
>>   File "zipextimporter.pyo", line 82, in load_module
>>   File "wx\__init__.pyo", line 45, in <module>
>>   File "zipextimporter.pyo", line 82, in load_module
>>   File "wx\_core.pyo", line 4, in <module>
>>   File "zipextimporter.pyo", line 98, in load_module
>> ImportError: MemoryLoadLibrary failed loading wx\_core_.pyd
See above, make sure that you use a version which includes ME, so 
gc.collect is run.
> and on 'clean' WinXp PC:
>> Traceback (most recent call last):
>>   File "Moro.py", line 1, in <module>
>>   File "zipextimporter.pyo", line 82, in load_module
>>   File "wx\__init__.pyo", line 45, in <module>
>>   File "zipextimporter.pyo", line 82, in load_module
>>   File "wx\_core.pyo", line 14244, in <module>
>>   File "zipextimporter.pyo", line 82, in load_module
>>   File "wx\_gdi.pyo", line 2972, in <module>
>>   File "wx\_gdi.pyo", line 2781, in AddCatalogLookupPathPrefix
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xf6 in position 
>> 33: ordinal not in range(128)
This is a totally different problem.   I think this could be fixed by 
changing your default encoding to something other then ascii.

I do this in my wx.App module:
if hasattr(sys, "frozen"):  #Py2Exe does not run Site.py
    sys.setdefaultencoding('iso-8859-1')
    del sys.setdefaultencoding   

>
> Should we consider these annoying results stating, that 
> (Py2exe)-'compiled' .exe-files cannot run in any other PC´s if 
> Python-Sw´s are not pre-installed ?? (ie. platform/OS/version - conflict)
I don't think this is the case.  Otherwise why even bother having py2exe 
- BTW, which version of py2exe are you using?
>
> or
>
> Are there still error somewhere ?
Yeap, this is more like it:)

If you still have problems I suggest that you create a small sample 
application which shows the problem and post it here together with your 
setup.py.

Werner




More information about the wxpython-users mailing list