[Pythonmac-SIG] py2app newbie problems

Arthur Debert debert at gmail.com
Mon Jun 27 18:38:13 CEST 2005


Hi Bob.

Thanks for your prompt answer.
Yes, you were obvioulsy right, my sources files had null bytes on
them. The funny thing is, I got them cutting and pasting code from the
the wx demo... evil...

If I can make a suggestions, when you can, write an error message that
will warn about this together with the offending source file, line
number and char number. If that's possible, that would be great help!

I've hacked a utility to remove null byte chars from python source
files. It's not very efficient(the way it's reading the sources files
and all) but it works, maybe it can help somebody. I am attaching it
to this email, maybe it will be useful.

Again, thanks for you help, 
Arthur

2005/6/27, Bob Ippolito <bob at redivi.com>:
> On Jun 27, 2005, at 12:36 AM, Arthur Debert wrote:
> 
> > Sorry if this is too basic, but I'm having real trouble getting
> > py2app working.
> > I have an application writen in python 2.4 that uses wxPython(2.6)
> > and 4Suite.
> >
> > Two questions:
> > a) i can't make much sense about this on the documentation. From what
> > I understood, all I have to do is point the setup.py script to the
> > 'main' script of my application, and the module graph should find and
> > package all the needed frameworks (such as wxPython and 4Suite). Is
> > this right? If not, where should I specify that I am using these
> > frameworks?
> >
> > b) when tryiing to build setup.py I get the following error:
> > "
> > TypeError: compile() expected string without null bytes
> >
> >> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
> >> site-packages/py2app/modulegraph/modulegraph.py(376)load_module()
> >>
> > -> co = compile (fp.read().replace("\r\n", "\n")+'\n',pathname,
> > 'exec')
> > "
> >
> > ouch! what does that mean?
> 
> It means what it says, one of your Python scripts has null bytes in
> it.  That shouldn't happen.  I've never seen it happen with wx, so
> it's either your code or 4suite.  I'll have the next version of
> py2app do something nicer when that happens.  No idea when I'll have
> time to do that, though.
> 
> -bob
> 
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullbyteremover.py
Type: text/x-python-script
Size: 1122 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20050627/ded98de0/nullbyteremover.bin


More information about the Pythonmac-SIG mailing list