Fail when building a windows executable

Bug #1081155 reported by Charles Roduit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Before, the command :
python setup.py bdist_wininst
created a windows installer file for a pure python project from any platform (linux too).

Now, the command retunrs errors :

Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules _winreg, win32api or win32con are installed.
Traceback (most recent call last):
  File "setup.py", line 28, in <module>
    scripts = ['openfovea-gtk']
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/bdist_wininst.py", line 189, in run
    self.create_exe(arcname, fullname, self.bitmap)
  File "/usr/lib/python2.7/distutils/command/bdist_wininst.py", line 271, in create_exe
    file.write(self.get_exe_bytes())
  File "/usr/lib/python2.7/distutils/command/bdist_wininst.py", line 366, in get_exe_bytes
    raise DistutilsFileError, str(msg) + ', %s not included in the Debian packages.' % filename
NameError: global name 'DistutilsFileError' is not defined

This error can be corrected by adding the DistutilsFileError in the import section (line 17, of the bdist_wininst.py file). When making so, the error is as follow :

Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules _winreg, win32api or win32con are installed.
error: [Errno 2] No such file or directory: '/usr/lib/python2.7/distutils/command/wininst-6.0.exe', /usr/lib/python2.7/distutils/command/wininst-6.0.exe not included in the Debian packages.

And there is no way to find this "wininst-6.0.exe" in any packages.

Thank for your help,

Charles

Revision history for this message
Matthias Klose (doko) wrote :

I'll fix the traceback, however we cannot include the .exe files, because these are not built from source. Hint: copy these from the source package

Changed in python2.7 (Ubuntu):
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (9.8 KiB)

This bug was fixed in the package python2.7 - 2.7.3-5ubuntu5

---------------
python2.7 (2.7.3-5ubuntu5) raring; urgency=low

  * Update to 20121128, taken from the 2.7 branch.
    - Issue #9011: Fix hacky AST code that modified the CST when compiling
      a negated numeric literal.
    - Issue #16306: Fix multiple error messages when unknown command line
      parameters where passed to the interpreter.
    - Issue #15379: Fix passing of non-BMP characters as integers for the
      charmap decoder (already working as unicode strings).
    - Issue #16453: Fix equality testing of dead weakref objects.
    - Issue #9535: Fix pending signals that have been received but not yet
      handled by Python to not persist after os.fork() in the child process.
    - Issue #15001: fix segfault on "del sys.modules['__main__']".
    - Issue #5057: the peepholer no longer optimizes subscription on unicode
      literals (e.g. u'foo'[0]) in order to produce compatible pyc files
      between narrow and wide builds.
    - Issue #8401: assigning an int to a bytearray slice (e.g. b[3:4] = 5)
      now raises an error.
    - Issue #14700: Fix buggy overflow checks for large width and precision
      in string formatting operations.
    - Issue #16345: Fix an infinite loop when ``fromkeys`` on a dict subclass
      received a nonempty dict from the constructor.
    - Issue #6074: Ensure cached bytecode files can always be updated by the
      user that created them, even when the source file is read-only.
    - Issue #14783: Improve int() and long() docstrings and switch docstrings
      for unicode(), slice(), range(), and xrange() to use multi-line
      signatures.
    - Issue #16030: Fix overflow bug in computing the `repr` of an xrange
      object with large start, step or length.
    - Issue #16029: Fix overflow bug occurring when pickling xranges with large
      start, step or length.
    - Issue #16037: Limit httplib's _read_status() function to work around
      broken HTTP servers and reduce memory usage (backport of a 3.2 fix).
    - Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
      sporadic crashes in multi-thread programs when several long deallocator
      chains ran concurrently and involved subclasses of built-in container
      types.
    - Issue #15801: Make sure mappings passed to '%' formatting are actually
      subscriptable.
    - Issue #15604: Update uses of PyObject_IsTrue() to check for and handle
      errors correctly.
    - Issue #15897: zipimport.c doesn't check return value of fseek().
    - Issue #16369: Global PyTypeObjects not initialized with PyType_Ready(...).
    - Issue #15033: Fix the exit status bug when modules invoked using
      -m switch, return the proper failure return value (1).
    - Issue #1160: Fix compiling large regular expressions on UCS2 builds.
    - Issue #14313: zipfile now raises NotImplementedError when the compression
      type is unknown.
    - Issue #16408: Fix file descriptors not being closed in error conditions
      in the zipfile module.
    - Issue #16327: The subprocess module no longer leaks file descriptors
      used for stdin/stdout/stderr pipes to the child...

Changed in python2.7 (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
lcampagn (luke-campagnola) wrote :

The .exe file should be included as data; it is not meant to be executable on linux.

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.