cxfreeze crashed with TypeError in _LoadModule() when trying to freeze an executable

Bug #633594 reported by Dat Chu
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cx-freeze (Ubuntu)
Fix Released
Medium
Dustin Kirkland 

Bug Description

Binary package hint: cx-freeze

Create a simple python file: helloworld.py with the following content

print "Hello, World!"

Then do cxfreeze helloworld.py

Crashes with the errors

copying /usr/lib/pymodules/python2.6/cx_Freeze/bases/Console -> /home/dchu/Desktop/cxfreeze/dist/helloworld
copying /usr/lib/libpython2.6.so.1.0 -> /home/dchu/Desktop/cxfreeze/dist/libpython2.6.so.1.0
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 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

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: cx-freeze 4.0.1-0ubuntu3
ProcVersionSignature: Ubuntu 2.6.35-20.29-generic 2.6.35.4
Uname: Linux 2.6.35-20-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Wed Sep 8 17:06:44 2010
ExecutablePath: /usr/bin/cxfreeze
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
InterpreterPath: /usr/bin/python2.6
ProcCmdline: /usr/bin/python2.6 /usr/bin/cxfreeze /home/username/src/urxd-python/urxd/PoseEstimation/PoseEstimation.py
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_US.utf8
PythonArgs: ['/usr/bin/cxfreeze', '/home/username/src/urxd-python/urxd/PoseEstimation/PoseEstimation.py']
SourcePackage: cx-freeze
Title: cxfreeze crashed with TypeError in _LoadModule()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Related branches

Revision history for this message
Dat Chu (dattanchu) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Changed in cx-freeze (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cx-freeze - 4.0.1-0ubuntu6

---------------
cx-freeze (4.0.1-0ubuntu6) precise; urgency=low

  * debian/patches/handle_pyc_in_load_module.patch: LP: #473610, #633594
    - the web is crawling with reports of cx-freeze failing to compile
      even simple hello world python code
    - I have reproduced the issue on multiple Ubuntu development system,
      and adapted a "fix" from:
      + http://ubuntuforums.org/showthread.php?t=1500926
    - basically, .pyc files need to be handled in a special manner
 -- Dustin Kirkland <email address hidden> Mon, 13 Feb 2012 16:02:12 -0600

Changed in cx-freeze (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.