A real annoying issue: Python, wxPython or py2exe?

Hi,

I'm preparing psi, my Python shell, for Python 2.5 and wxPython 2.7.1.2 :
http://spinecho.ifrance.com/
psi is available in two forms: as Python scripts or as exe for win32.

The problem: while the script version is working, the exe version
fail. As we say in French, "I'm loosing my Latin", because I really do
not know from where the problem is coming and where to search: Python
or py2exe? wxPython does not seem to be the origin of the problem.

Some miscellaneous reports:

psi71: Python 2.4.3, wxPython 2.6.3.2-ansi, win2k + sp4, py2exe 0.6.5

After having enter "uuu" in the shell, I got
>>> uuu
Traceback (most recent call last):
   File "<psi-last-command>", line 1, in ?
NameError: name 'uuu' is not defined

This is ok, but

p71xxx: a junk version for this testing purpose, Python 2.5, wxPython 2.7.1.2-ansi,
win2k + sp4, py2exe 0.6.5

>>>uuu
Traceback (most recent call last):
   File "psiShell.pyc", line 133, in OnKeyDown
   File "psiShell.pyc", line 328, in ProcessCmd
   File "psiMoteur.pyc", line 127, in mrun
   File "psiMoteur.pyc", line 138, in showtraceback
   File "traceback.pyc", line 101, in extract_tb
TypeError: fake_getline() takes exactly 2 arguments (3 given)

psi72: Python 2.5, wxPython 2.6.3.3-ansi, win2k + sp4, py2exe 0.6.5

>>>uuu
Traceback (most recent call last):
   File "psiShell.pyc", line 137, in OnKeyDown
   File "psiShell.pyc", line 324, in ProcessCmd
   File "code.pyc", line 87, in runsource
   File "code.pyc", line 107, in runcode
   File "code.pyc", line 154, in showtraceback
   File "traceback.pyc", line 101, in extract_tb
TypeError: fake_getline() takes exactly 2 arguments (3 given)

psi73: Python 2.5, wxPython 2.7.1.2-ansi, win2k + sp4, py2exe 0.6.5

>>>uuu
Traceback (most recent call last):
   File "psiShell.pyc", line 133, in OnKeyDown
   File "psiShell.pyc", line 320, in ProcessCmd
   File "code.pyc", line 87, in runsource
   File "code.pyc", line 107, in runcode
   File "code.pyc", line 154, in showtraceback
   File "traceback.pyc", line 101, in extract_tb
TypeError: fake_getline() takes exactly 2 arguments (3 given)

I do not find any "fake_getline() the traceback.py file!

Any suggestion?

Jean-Michel Fauth, Switzerland

Hi Jean Michel,

   I would guess it's Python/py2exe problem of non back-compatibility. >From a quick google search:

"
Seems to stem from the addition of an extra parameter to
linecache.getline in Python 2.5.

http://aspn.activestate.com/ASPN/Mail/Message/py2exe-users/3216424

As that post says :

Changing:

def fake_getline(filename, lineno):

in boot_common.py to:

def fake_getline(filename, lineno, module_globals=None):

may solve the problem.
"

HTH.

Andrea.

···

_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London

Direct Tel: +44 (0) 20 717 08936
Mobile Tel: +44 (0) 77 487 70534
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯