Merge lp://qastaging/~xnox/bzr-dbus/pygi into lp://qastaging/bzr-dbus

Proposed by Dimitri John Ledkov
Status: Merged
Approved by: Richard Wilbur
Approved revision: 53
Merged at revision: 53
Proposed branch: lp://qastaging/~xnox/bzr-dbus/pygi
Merge into: lp://qastaging/bzr-dbus
Diff against target: 251 lines (+31/-30)
2 files modified
activity.py (+6/-5)
tests/test_activity.py (+25/-25)
To merge this branch: bzr merge lp://qastaging/~xnox/bzr-dbus/pygi
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve
Richard Wilbur Approve
Martin Pitt (community) Approve
Review via email: mp+137173@code.qastaging.launchpad.net

Commit message

Remove PyGIDeprecationWarnings

Description of the change

Resolve Bug #1095884: "bzr showing PyGIDeprecationWarning for all actions." by moving from using deprecated interfaces of GObject to undeprecated interfaces of GLib.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

One left:
PyGIDeprecationWarning: Calling io_add_watch with a file object is deprecated; call it with a GLib.IOChannel object

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

This looks good to me, thanks! Don't worry about the IOChannel warning; I think deprecating this one was a bit overzealous, supporting this mode is not all that expensive (unlike calling it with wrong arguments). I dropped the warning in

http://git.gnome.org/browse/pygobject/commit/?id=945263a8

review: Approve
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Looks good to me. Thanks for fixing up the code rot by moving bzr-dbus to the blessed interfaces.
+1

review: Approve
Revision history for this message
Robert Bruce Park (robru) wrote :

Works for me, too!

review: Approve
Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

FYI, the fix isn't backwards compatible (not sure if it aims to be). It creates a number of test failures on Debian sid with python-gobject-2, though it might just be time to drop all the 'import glib as GLib' stuff. They also fail with the versions of python-gi in both sid and experimental.

======================================================================
ERROR: bzrlib.plugins.dbus.tests.test_activity.TestLanGateway.test_network_packets_trigger_handle_network_packet
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/tests/test_activity.py", line 516, in test_network_packets_trigger_handle_network_packet
    gateway.run(_port=0)
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/activity.py", line 313, in run
    self.start(_port)
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/activity.py", line 332, in start
    GLib.io_add_watch(self.sock, GLib.PRIORITY_HIGH, GLib.IO_IN, self.handle_network_packet)
TypeError: third argument not callable

======================================================================
ERROR: bzrlib.plugins.dbus.tests.test_activity.TestLanGateway.test_run_binds
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/tests/test_activity.py", line 493, in test_run_binds
    gateway.run(_port=0)
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/activity.py", line 313, in run
    self.start(_port)
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/activity.py", line 332, in start
    GLib.io_add_watch(self.sock, GLib.PRIORITY_HIGH, GLib.IO_IN, self.handle_network_packet)
TypeError: third argument not callable

======================================================================
ERROR: bzrlib.plugins.dbus.tests.test_activity.TestLanGateway.test_run_listens_for_revisions
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/tests/test_activity.py", line 543, in test_run_listens_for_revisions
    gateway.run(_port=0)
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/activity.py", line 313, in run
    self.start(_port)
  File "/tmp/buildd/bzr-dbus-0.1~bzr53/activity.py", line 332, in start
    GLib.io_add_watch(self.sock, GLib.PRIORITY_HIGH, GLib.IO_IN, self.handle_network_packet)
TypeError: third argument not callable

----------------------------------------------------------------------
Ran 37 tests in 1.092s

FAILED (errors=3)

Revision history for this message
Robert Bruce Park (robru) wrote :

Andrew, can you try my branch briefly? I ran the testsuite and didn't get the errors you say.

I wrote this a little while ago and don't remember all the details, but I do vaguely remember going into a python2 interactive shell and trying "import glib as GLib" and then poking some of the methods interactively, and seeing that it was working.

https://code.launchpad.net/~robru/bzr-dbus/glib

(also, I think this branch is more complete, as it no longer imports gobject at all)

Thanks!

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

Robert,

I was able to successfully run the test suite in a minimal Debian sid chroot using your branch with python-gi installed as well as with only python-gobject-2.

Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

On Sun, Jan 27, 2013 at 1:39 PM, Andrew Starr-Bochicchio
<email address hidden> wrote:
> FYI, the fix isn't backwards compatible (not sure if it aims to be). It creates a number of test
> failures on Debian sid with python-gobject-2, though it might just be time to drop all the
> 'import glib as GLib' stuff. They also fail with the versions of python-gi in both sid and experimental.

Andrew,

I must confess that I wasn't looking for backwards compatibility since
we were merging into trunk of bzr-dbus, but if we can have our cake
and eat it too...

So what version of bzr, python, etc. are you testing against?

I thought the original incompatibility this branch intended to fix was
a problem with GObject API deprecation but the test failures you see
complain about GLib usage. Is it due to an older version of GLib, or
possibly something else?

Richard

Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

On Sun, Jan 27, 2013 at 2:21 PM, Robert Bruce Park
<email address hidden> wrote:
[...]
> https://code.launchpad.net/~robru/bzr-dbus/glib
>
> (also, I think this branch is more complete, as it no longer imports gobject at all)
[...]

It sounds like this is a better solution than what was previously
merged. Is your branch ready to merge? If so, would you be willing
to propose a merge? I would be happy to approve it.

Sincerely,

Richard

Revision history for this message
Robert Bruce Park (robru) wrote :

On Thu, Mar 21, 2013 at 05:55:22AM -0000, Richard Wilbur wrote:
> It sounds like this is a better solution than what was previously
> merged. Is your branch ready to merge? If so, would you be willing
> to propose a merge? I would be happy to approve it.

Ah, I figured the issue was moot at this point. But, since you've
shown an interest, I've rebased my branch on master and submitted a
new mp. Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches