schmir/bbfreeze — Issue #8: struct.error on Mac OS X
Author: lrowe
Created: 2011-11-14 19:30:34+00:00
State: open

Running with python 2.7 from python.org on Mac OS 10.6 I get the following error packing a simple "Hello, world!" script.

```
$ cat test.py
print "Hello, world!"
$ bb-freeze test.py
*** applied
*** applied
Traceback (most recent call last):
File "/usr/local/bin/bb-freeze", line 9, in
load_entry_point('bbfreeze==0.97.3', 'console_scripts', 'bb-freeze')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/__init__.py", line 25, in main
f()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/freezer.py", line 602, in __call__
self.finish_dist()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/freezer.py", line 614, in finish_dist
m.run(contents="@executable_path/")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/macholib/MachOStandalone.py", line 101, in run
for fn in platfiles:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/macholib/util.py", line 227, in iter_platform_files
if is_platform_file(fn):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/macholib/util.py", line 206, in is_platform_file
header = mach_o.fat_header.from_fileobj(fileobj, _endian_='>')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/macholib/ptypes.py", line 44, in from_fileobj
return cls.from_str(f.read(cls._size_), **kw)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bbfreeze-0.97.3-py2.7-macosx-10.6-intel.egg/bbfreeze/macholib/ptypes.py", line 48, in from_str
return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw)
struct.error: unpack requires a string argument of length 8
```