From: Luis Quesada on
On Apr 14, 6:31 am, "Gabriel Genellina" <gagsl-...(a)yahoo.com.ar>
wrote:
> En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada <l.ques...(a)4c.ucc.ie>  
> escribi :
>
> > I am getting an "expected string without null bytes" error when using  
> > cxfreeze for creating a standalone application (in Linux-Ubuntu). None  
> > of my files has null bytes.
>
> Are you sure? A text file saved as, e.g., UTF-16, does contain null bytes..
>
> > cxfreeze's output
> > ...
> >    File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 386, in  
> > IncludeFile
> >      deferredImports)
> >    File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 259, in  
> > _LoadModule
> >      module.code = compile(fp.read() + "\n", path, "exec")
> > TypeError: compile() expected string without null bytes
>
> I would add a few 'print' statements in finder.py to determine which file  
> is failing.
>

I did what you suggested: I modified finder.py so that it prints the
name of the module before the compile statement that triggers the
exception. This is what I get now:

lquesada(a)lquesada-laptop:~/workspace/MetroNode/src/models$ cxfreeze
uncovered.py --target-dir dist
compiling os
compiling posixpath
compiling stat
compiling genericpath
compiling warnings
compiling linecache
compiling types
compiling re
compiling sre_compile
compiling sre_parse
compiling sre_constants
compiling copy_reg
compiling UserDict
compiling _abcoll
compiling abc
compiling copy
compiling repr
compiling subprocess
compiling traceback
compiling threading
compiling functools
compiling _strptime
compiling locale
compiling encodings
compiling codecs
compiling encodings.aliases
compiling calendar
compiling optparse
compiling textwrap
compiling string
compiling gettext
compiling struct
compiling StringIO
compiling token
compiling tokenize
compiling dummy_thread
compiling collections
compiling keyword
compiling doctest
compiling __future__
compiling inspect
compiling dis
compiling opcode
compiling unittest
compiling getopt
compiling difflib
compiling heapq
compiling bisect
compiling pdb
compiling cmd
compiling bdb
compiling pprint
compiling shlex
compiling tempfile
compiling random
compiling _threading_local
compiling pickle
compiling __main__
compiling Numberjack
compiling Decomp
copying /usr/lib/pymodules/python2.6/cx_Freeze/bases/Console -> dist/
uncovered
copying /usr/lib/libpython2.6.so.1.0 -> dist/libpython2.6.so.1.0
compiling cx_Freeze__init__
Traceback (most recent call last):
File "/usr/bin/cxfreeze", line 5, in <module>
main()
File "/usr/lib/pymodules/python2.6/cx_Freeze/main.py", line 170, in
main
freezer.Freeze()
File "/usr/lib/pymodules/python2.6/cx_Freeze/freezer.py", line 405,
in Freeze
self._FreezeExecutable(executable)
File "/usr/lib/pymodules/python2.6/cx_Freeze/freezer.py", line 173,
in _FreezeExecutable
exe.copyDependentFiles, scriptModule)
File "/usr/lib/pymodules/python2.6/cx_Freeze/freezer.py", line 333,
in _WriteModules
initModule = finder.IncludeFile(initScript, "cx_Freeze__init__")
File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 387,
in IncludeFile
deferredImports)
File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 260,
in _LoadModule
module.code = compile(fp.read() + "\n", path, "exec")
TypeError: compile() expected string without null bytes

Now I even more confused since it seems the problem is taking place
when trying cx_Freeze__init__ ....
Cheers,
Luis
From: Gabriel Genellina on
En Wed, 14 Apr 2010 06:10:59 -0300, Luis Quesada
<luis.omar.quesada.ramirez(a)gmail.com> escribi�:

> On Apr 14, 6:31 am, "Gabriel Genellina" <gagsl-...(a)yahoo.com.ar>
> wrote:
>> En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada <l.ques...(a)4c.ucc.ie>
>> escribi :
>>
>> > I am getting an "expected string without null bytes" error when using
>> > cxfreeze for creating a standalone application (in Linux-Ubuntu). >
>> None > of my files has null bytes.

> This is what I get now:
> ...
> compiling cx_Freeze__init__
> Traceback (most recent call last):
> ...
> File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 260,
> in _LoadModule
> module.code = compile(fp.read() + "\n", path, "exec")
> TypeError: compile() expected string without null bytes
>
> Now I even more confused since it seems the problem is taking place
> when trying cx_Freeze__init__ ....

Yes, looks like a problem within cx_Freeze itself. Sorry, I cannot be of
more help, I don't use the tool myself.

Try asking in the project's mailing list
<http://cx-freeze.sourceforge.net>, I think you may get more specific help
there. (Also, try using the latest cx_Freeze release, this may have been
already fixed).

--
Gabriel Genellina

From: Luis Quesada on
On Apr 14, 11:06 am, "Gabriel Genellina" <gagsl-...(a)yahoo.com.ar>
wrote:
> En Wed, 14 Apr 2010 06:10:59 -0300, Luis Quesada  
> <luis.omar.quesada.rami...(a)gmail.com> escribió:
>
>
>
> > On Apr 14, 6:31 am, "Gabriel Genellina" <gagsl-...(a)yahoo.com.ar>
> > wrote:
> >> En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada <l.ques...(a)4c.ucc.ie>  
> >> escribi :
>
> >> > I am getting an "expected string without null bytes" error when using  
> >> > cxfreeze for creating a standalone application (in Linux-Ubuntu). >  
> >> None > of my files has null bytes.
> > This is what I get now:
> > ...
> > compiling cx_Freeze__init__
> > Traceback (most recent call last):
> >   ...
> >   File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 260,
> > in _LoadModule
> >     module.code = compile(fp.read() + "\n", path, "exec")
> > TypeError: compile() expected string without null bytes
>
> > Now I even more confused since it seems the problem is taking place
> > when trying cx_Freeze__init__ ....
>
> Yes, looks like a problem within cx_Freeze itself. Sorry, I cannot be of  
> more help, I don't use the tool myself.
>
> Try asking in the project's mailing list  
> <http://cx-freeze.sourceforge.net>, I think you may get more specific help  
> there. (Also, try using the latest cx_Freeze release, this may have been  
> already fixed).
>

Thanks Gabriel. I will try cx-freeze's mailing list.
Cheers
Luis
From: Lawrence D'Oliveiro on
In message <fbdf4a20-1fe2-4c23-9ee2-
c6e739362aa1(a)12g2000yqi.googlegroups.com>, Jonathan Hartley wrote:

> On Apr 13, 10:42�pm, Lawrence D'Oliveiro
> <ldo(a)geek-central.gen.new_zealand> wrote:
>
>> In message <kZ4xn.868$I8....(a)news.indigo.ie>, Luis Quesada wrote:
>>
>> > I am getting an "expected string without null bytes" error when using
>> > cxfreeze for creating a standalone application (in Linux-Ubuntu).
>>
>> Why bother? Every decent Linux system will have Python available. Why not
>> just distribute it as a script?
>
> Anything other than a trivial script will have dependencies. These
> might be other Python packages, C-extensions, and other libraries.
> What if your program runs on a version of Python other than the one
> installed on the client's Linux system?

Let the distro maintainers worry about that. They will package your code up
in the appropriate form, so that the system package manager will
automatically ensure that the right dependencies are present. Problem
solved, no need to keep reinventing the wheel.
From: Lawrence D'Oliveiro on
In message <4BC4EC17.3040605(a)4c.ucc.ie>, Luis Quesada wrote:

> Lawrence D'Oliveiro wrote:
>
>> In message <kZ4xn.868$I8.457(a)news.indigo.ie>, Luis Quesada wrote:
>>
>>> I am getting an "expected string without null bytes" error when using
>>> cxfreeze for creating a standalone application (in Linux-Ubuntu).
>>
>> Why bother? Every decent Linux system will have Python available. Why not
>> just distribute it as a script?
>
> Well every decent Linux system will have Java available too ...

Questionable. Java doesn't seem to be of much importance in the mass market,
it seems to be primarily for corporate use.
First  |  Prev  | 
Pages: 1 2
Prev: Python, CGI and Sqlite3
Next: mailbox multipart