Donate Share

PythonCard

Tracker: Bugs

5 ythonCard and py2exe bug - ID: 1591897
Last Update: Comment added ( baxeno )

I've have success to compile _PythonCard-0.8.2.win32_
sample programs with _py2exe_ but these programs
doesn't run because the trouble below:
/
Minimal.exe.log/
Traceback (most recent call last):
File "minimal.py", line 14, in ?
File "PythonCard\model.pyc", line 366, in __init__
File "PythonCard\resource.pyc", line 45, in __init__
File "PythonCard\util.pyc", line 39, in
readAndEvalFile
TypeError: coercing to Unicode: need string or buffer,
NoneType found


py2exe version = 0.6.5.win32-py2.4
wxPython version = 2.7-win32-2.7.1.3-py24
Python version = 2.4.4

Minimal.py error details:

Traceback (most recent call last):
File "minimal.py", line 14, in ?
comand line -> app = model.Application(Minimal)


File "PythonCard\model.pyc", line 366, in __init__
comand line -> self.resource = resource.ResourceFile
(aFileName).getResource()


File "PythonCard\resource.pyc", line 45, in __init__
comand line -> self.dictionary = ReadAndEvalFile
(rsrcFileName)



File "PythonCard\util.pyc", line 39, in
readAndEvalFile
comand line -> f = open(filename)


TypeError: coercing to Unicode: need string or buffer,
NoneType found

from fxl@onda.com.br


Nobody/Anonymous ( nobody ) - 2006-11-07 10:14

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 2 )




Date: 2009-04-20 21:46
Sender: baxenoSourceForge.net Donor

Your compiled application is lacking the resource fil (minimal.rsrc.py).
This can be fixed in 2 ways:

1. Include resource file inside minimal.py

rsrc = "minimal.rsrc.py data"

and change:
app = model.Application(Minimal)
to:
app = model.Application(Minimal, None, rsrc)

2. Copy minimal.rsrc.py to the compile output folder (.\dist\)

Can be done by adding it to the setup.py (used to setup compiler)
setup( data_files = [('.', ['minimal.rsrc.py'])] )



Date: 2007-06-28 16:17
Sender: nobody

Logged In: NO

I am having the same problem as this, were you able to rectify the
problem?

Please let me know.

PythonCard is great to use, but If I can't compile...


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.