schmir / bbfreeze

UNMAINTAINED
http://pypi.python.org/pypi/bbfreeze/
92 stars 22 forks source link

struct.error on Mac OS X #8

Closed lrowe closed 12 years ago

lrowe commented 12 years ago

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 <function recipe_doctest at 0x101218938>
*** applied <function recipe_time at 0x101218c80>
Traceback (most recent call last):
  File "/usr/local/bin/bb-freeze", line 9, in <module>
    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
schmir commented 12 years ago

Laurence Rowe reply@reply.github.com writes:

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

you can try upgrading macholib. Other than that I won't help you here since I lost all interest in supporting OS X. I will accept patches however...

schmir commented 12 years ago

macholib is gone from bbfreeze 1.0. that specific error shouldn't happen anymore, but freezing on OS X is most probably still broken.