Merge lp:~dobey/ubuntu/raring/twisted/fix-pygtkcompat into lp:ubuntu/raring/twisted

Proposed by dobey
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntu/raring/twisted/fix-pygtkcompat
Merge into: lp:ubuntu/raring/twisted
Diff against target: 65 lines (+45/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/lp1102685.diff (+36/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/raring/twisted/fix-pygtkcompat
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Ubuntu branches Pending
Review via email: mp+144550@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

The patch looks good to me and I'd happily sponsor it, but I have two suggestions:

* Could you add DEP 3 headers to the patch? http://dep.debian.net/deps/dep3/
* Is this appropriate for upstream? If so, please file the bug and patch upstream and include the url in the DEP 3 headers

I'll mark this as needs fixing for now, but those two things should be pretty easy to add and update.

review: Needs Fixing
53. By dobey

Add dep3 headers to patch.

Revision history for this message
Barry Warsaw (barry) wrote :

Looks great, thanks!

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

Apparently this got merged without pushing, closing manually.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-01-23 11:41:25 +0000
3+++ debian/changelog 2013-01-25 20:25:22 +0000
4@@ -1,3 +1,11 @@
5+twisted (12.3.0-1ubuntu4) raring; urgency=low
6+
7+ * debian/patches/lp1102685.diff:
8+ - Try to use plain pygtkcompat and fall back to gi.pygtkcompat, to
9+ avoid a DeprecationWarning, and a crash. (LP: #1102685)
10+
11+ -- Rodney Dawes <rodney.dawes@ubuntu.com> Wed, 23 Jan 2013 12:19:06 -0500
12+
13 twisted (12.3.0-1ubuntu3) raring; urgency=low
14
15 * Explicitly call 2to3 to build the py3k source.
16
17=== added file 'debian/patches/lp1102685.diff'
18--- debian/patches/lp1102685.diff 1970-01-01 00:00:00 +0000
19+++ debian/patches/lp1102685.diff 2013-01-25 20:25:22 +0000
20@@ -0,0 +1,36 @@
21+Description: Use pygtkcompat directly and fall back to gi.pygtkcompat
22+Bug: https://twistedmatrix.com/trac/ticket/6280
23+Author: Rodney Dawes <rodney.dawes@canonical.com>
24+=== modified file 'twisted/internet/gireactor.py'
25+--- old/twisted/internet/gireactor.py 2013-01-16 17:44:26 +0000
26++++ new/twisted/internet/gireactor.py 2013-01-23 17:13:29 +0000
27+@@ -37,9 +37,12 @@ else:
28+ from twisted.python.modules import theSystemPath
29+ _pygtkcompatPresent = True
30+ try:
31+- theSystemPath["gi.pygtkcompat"]
32++ theSystemPath["pygtkcompat"]
33+ except KeyError:
34+- _pygtkcompatPresent = False
35++ try:
36++ theSystemPath["gi.pygtkcompat"]
37++ except KeyError:
38++ _pygtkcompatPresent = False
39+
40+
41+ # Modules that we want to ensure aren't imported if we're on older versions of
42+@@ -75,8 +78,11 @@ else:
43+ # Newer version of gi, so we can try to initialize compatibility layer; if
44+ # real pygtk was already imported we'll get ImportError at this point
45+ # rather than segfault, so unconditional import is fine.
46+- import gi.pygtkcompat
47+- gi.pygtkcompat.enable()
48++ try:
49++ import pygtkcompat
50++ except ImportError:
51++ from gi import pygtkcompat
52++ pygtkcompat.enable()
53+ # At this point importing gobject will get you gi version, and importing
54+ # e.g. gtk will either fail in non-segfaulty way or use gi version if user
55+ # does gi.pygtkcompat.enable_gtk(). So, no need to prevent imports of
56+
57
58=== modified file 'debian/patches/series'
59--- debian/patches/series 2013-01-21 13:43:44 +0000
60+++ debian/patches/series 2013-01-25 20:25:22 +0000
61@@ -2,3 +2,4 @@
62 index-doc.diff
63 python3.diff
64 python3_modules.diff
65+lp1102685.diff

Subscribers

People subscribed via source and target branches

to all changes: