Bug 617782

Summary: PackageKit fails to build against python 2.7, giscanner/xmlwriter.py issue
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: gobject-introspectionAssignee: Colin Walters <walters>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: jonathan, otaylor, richard, smparrish, walters
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: gobject-introspection-0.9.2-5.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 22:36:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dave Malcolm 2010-07-23 23:30:23 UTC
Description of problem:
  GISCAN PackageKitGlib-1.0.gir
Traceback (most recent call last):
  File "/usr/bin/g-ir-scanner", line 36, in <module>
    from giscanner.scannermain import scanner_main
  File "/usr/lib64/gobject-introspection/giscanner/scannermain.py", line 31, in <module>
    from giscanner.dumper import compile_introspection_binary
  File "/usr/lib64/gobject-introspection/giscanner/dumper.py", line 26, in <module>
    from .glibtransformer import IntrospectionBinary
  File "/usr/lib64/gobject-introspection/giscanner/glibtransformer.py", line 34, in <module>
    from .transformer import Names
  File "/usr/lib64/gobject-introspection/giscanner/transformer.py", line 31, in <module>
    from .girparser import GIRParser
  File "/usr/lib64/gobject-introspection/giscanner/girparser.py", line 32, in <module>
    from .girwriter import COMPATIBLE_GIR_VERSION
  File "/usr/lib64/gobject-introspection/giscanner/girwriter.py", line 30, in <module>
    from .xmlwriter import XMLWriter
  File "/usr/lib64/gobject-introspection/giscanner/xmlwriter.py", line 70, in <module>
    with LibtoolImporter:
AttributeError: __exit__
make[4]: *** [PackageKitGlib-1.0.gir] Error 1
make[4]: Leaving directory `/builddir/build/BUILD/PackageKit-0.6.6/lib/packagekit-glib2'
make[3]: Leaving directory `/builddir/build/BUILD/PackageKit-0.6.6/lib/packagekit-glib2'
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/PackageKit-0.6.6/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/PackageKit-0.6.6'

Looks like this isn't compatible with python 2.7

http://docs.python.org/dev/whatsnew/2.7.html#porting-to-python-2-7 has this which seems the likely explanation:
"Because of an optimization for the with statement, the special methods __enter__() and __exit__() must belong to the object’s type, and cannot be directly attached to the object’s instance. This affects new-style classes (derived from object) and C extension types. (issue 6101.)"

Steps to Reproduce:
koji build dist-f14-py27-rebuild cvs://cvs.fedoraproject.org/cvs/pkgs?rpms/PackageKit/devel#PackageKit-0_6_6-3_fc14

Comment 1 Dave Malcolm 2010-07-23 23:31:55 UTC
Presumably affects any other packages that build .gir files; reassigning to "gobject-introspection"

Comment 2 Dave Malcolm 2010-07-26 00:39:39 UTC
There seems to be some discussion of this in the Python bug tracker:

Comment 4 Dave Malcolm 2010-07-26 10:44:12 UTC
I've tested with that patch and was successfully able to rebulid gtk-vnc on python 2.7 with in.

Committed to CVS; building gobject-introspection-0.9.2-5.fc14 into dist-f14-py27-rebuild as:

Comment 5 Bug Zapper 2010-07-30 12:48:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:

Comment 6 Fedora End Of Life 2012-08-16 22:36:45 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: