469,271 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

py2exe compression not working with Python 2.5

When I try to compress the output of py2exe like this:

from distutils.core import setup
import py2exe

setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})

I get strange error messages:

Adding zlib.pyd to C:\tests\CanControllerTest\New Folder
(2)\dist\library.zip
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})
File "C:\Python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 218,
in run
self._run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 285,
in _run
self.create_binaries(py_files, extensions, dlls)
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591,
in create_
binaries
bytes = zlib_file.read()
AttributeError: 'NoneType' object has no attribute 'read'

This is a standard Python 2.5 installation. Doing the same thing with
2.4 works like a charm.

Did I miss anything?

Sep 22 '06 #1
2 1776
nikie schrieb:
When I try to compress the output of py2exe like this:

from distutils.core import setup
import py2exe

setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})

I get strange error messages:

Adding zlib.pyd to C:\tests\CanControllerTest\New Folder
(2)\dist\library.zip
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})
File "C:\Python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 218,
in run
self._run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 285,
in _run
self.create_binaries(py_files, extensions, dlls)
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591,
in create_
binaries
bytes = zlib_file.read()
AttributeError: 'NoneType' object has no attribute 'read'

This is a standard Python 2.5 installation. Doing the same thing with
2.4 works like a charm.

Did I miss anything?
Patches for this have been posted to the py2exe-users list.

Thomas

Sep 22 '06 #2
Thomas Heller wrote:
nikie schrieb:
When I try to compress the output of py2exe like this:

from distutils.core import setup
import py2exe

setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})

I get strange error messages:

Adding zlib.pyd to C:\tests\CanControllerTest\New Folder
(2)\dist\library.zip
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(console=['hello.py'], options={"py2exe": {"compressed": 1}})
File "C:\Python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 218,
in run
self._run()
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 285,
in _run
self.create_binaries(py_files, extensions, dlls)
File "C:\Python25\lib\site-packages\py2exe\build_exe.py", line 591,
in create_
binaries
bytes = zlib_file.read()
AttributeError: 'NoneType' object has no attribute 'read'

This is a standard Python 2.5 installation. Doing the same thing with
2.4 works like a charm.

Did I miss anything?
Patches for this have been posted to the py2exe-users list.
Doh, should have looked there first...

Thanks a lot!

Sep 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Thomas Heller | last post: by
1 post views Thread by Funduk | last post: by
reply views Thread by David Vaughan | last post: by
11 posts views Thread by Timothy Smith | last post: by
true911m
4 posts views Thread by true911m | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
1 post views Thread by Jimmy Retzlaff | last post: by
reply views Thread by Larry Bates | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.