Problem importing codegen from desextras

Bug #57182 reported by Barry deFreese
6
Affects Status Importance Assigned to Milestone
PyGTK
Fix Released
Medium
pygobject (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Hello,

In trying to build diacanvas2 in Edgy, I recieve the following error:

#
copying ./placementtool.py -> build/lib.linux-i686-2.4/diacanvas
#
running build_ext
#
Traceback (most recent call last):
#
  File "setup.py", line 171, in ?
#
    cmdclass={'build_ext': BuildExt})
#
  File "distutils/core.py", line 149, in setup
#
  File "distutils/dist.py", line 946, in run_commands
#
  File "distutils/dist.py", line 966, in run_command
#
  File "distutils/command/install.py", line 519, in run
#
  File "/usr/lib/python2.4/cmd.py", line 333, in run_command
#
    del help[cmd]
#
  File "distutils/dist.py", line 966, in run_command
#
  File "distutils/command/build.py", line 112, in run
#
  File "/usr/lib/python2.4/cmd.py", line 333, in run_command
#
    del help[cmd]
#
  File "distutils/dist.py", line 966, in run_command
#
  File "distutils/command/build_ext.py", line 279, in run
#
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 132, in build_extensions
#
    build_ext.build_extensions(self)
#
  File "distutils/command/build_ext.py", line 405, in build_extensions
#
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 139, in build_extension
#
    ext.generate()
#
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 387, in generate
#
    map(lambda x: x.generate(), self.templates)
#
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 387, in <lambda>
#
    map(lambda x: x.generate(), self.templates)
#
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 340, in generate
#
    from codegen import register_types, write_source, FileOutput
#
ImportError: cannot import name write_source
#
make: *** [install-python2.4] Error 1
#
pbuilder: Failed autobuilding of package

Thank you.

Revision history for this message
Wouter van Heyst (larstiq) wrote :

This seems to have change in 1.110 of codegen.py:

http://cvs.gnome.org/viewcvs/pygtk/codegen/codegen.py?r1=1.110&r2=1.111

The message is just '* codegen/codegen.py: Refactor a big chunk into a class with methods.'

The change introduces a class SourceWriter that bundles the functions that did the source writing.

A call changes from:

    write_source(p, o, prefix, FileOutput(sys.stdout, outfilename))

to

    sw = SourceWriter(p, o, prefix, FileOutput(sys.stdout, outfilename))
    sw.write()

Making corresponding changes to /var/lib/python-support/python2.4/gtk-2.0/dsextras.py lets the build continue, only to fail in:

  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 360, in generate
    Overrides(self.override),
  File "//usr/share/pygtk/2.0/codegen/override.py", line 49, in __init__
    self.handle_file(filename)
  File "//usr/share/pygtk/2.0/codegen/override.py", line 81, in handle_file
    self.__parse_override(buf, startline, filename)
  File "//usr/share/pygtk/2.0/codegen/override.py", line 130, in __parse_override
    raise RuntimeError("Function %s is being overridden more than once" % (func,))

Daniel T Chen (crimsun)
Changed in pygobject:
importance: Untriaged → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Matti Lindell (mlind) wrote :

Bug #60583 ends up with a similar compile error. Probably codegen/codegen.py doing something it shouldn't.

Revision history for this message
Steve Kowalik (stevenk) wrote :

I have reported this problem upstream, as bug #356556

http://bugzilla.gnome.org/show_bug.cgi?id=356556

I'm just having trouble linking it into this bug...

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for forward it. You can click on the "Upstream" link displayed after the table listing the task to add an upstream task

Revision history for this message
Sebastien Bacher (seb128) wrote :

Fixed upstream

Changed in pygobject:
assignee: nobody → desktop-bugs
status: Confirmed → Fix Committed
Revision history for this message
William Grant (wgrant) wrote :

Why has it been marked as `Fix Committed' in Ubuntu? Upstream may have it fixed, but Ubuntu hasn't.

Revision history for this message
Sebastien Bacher (seb128) wrote :

We use "Fix Committed" when the bug is fixed upstream and "Fix Released" when the fixed version is uploaded

Changed in pygtk:
status: Unknown → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

This upload fixes the issue:

" pygobject (2.12.2-0ubuntu1) edgy; urgency=low
 .
   * New upstream version:
     - Make PyGObject 64-bit safe for Python 2.5
     - All headers are now LGPL and not GPL
     - Remove a couple of GCC warnings
     - Revive distutils support (Ubuntu: #57182)
     - Emission hook reference count bugfix
     - MSVC/ANSI C compilation fix
     - Bump Ctrl-C timeout handler from 100ms to 1000
"

Changed in pygobject:
status: Fix Committed → Fix Released
Changed in pygtk:
importance: Unknown → Medium
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.