py2exe compression not working with Python 2.5

N

nikie

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?
 
T

Thomas Heller

nikie said:
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
 
N

nikie

Thomas said:
nikie said:
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top