Opened 2 years ago

Last modified 5 weeks ago

#6369 defect new

io_add_watch API change in pygobject >= 3.7.3

Reported by: dobey Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug: 1098127

Description (last modified by exarkun)

The API has changed slightly in pygobject 3.7.3 and newer, so twisted based programs which use the glib based reactors will result in having PyGIDeprecationWarning messages printed when the io_add_watch method is called:

/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py:656: PyGIDeprecationWarning: Calling io_add_watch without priority as second argument is deprecated
  PyGIDeprecationWarning)
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py:667: PyGIDeprecationWarning: Calling io_add_watch with priority keyword argument is deprecated, put it as second positional argument
  PyGIDeprecationWarning)

Attachments (1)

lp1098127.diff (966 bytes) - added by dobey 2 years ago.
Patch to support new and old io_add_watch API

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by dobey

Patch to support new and old io_add_watch API

comment:1 Changed 2 years ago by exarkun

  • Description modified (diff)

comment:2 Changed 18 months ago by zaheerm

Any movement on this? Lots of noise currently in stderr:

PyGIDeprecationWarning: Calling io_add_watch with priority keyword argument is deprecated, put it as second positional argument

comment:3 Changed 18 months ago by exarkun

We could probably apply the given patch as-is if we had buildslaves set up to test the various different versions involved.

Alternatively we could apply a simpler patch that just avoids the warning on newer versions of pygtk and declare older versions unsupported.

The versions of pygtk installed on our buildslaves can be found by looking at the page for any individual build (found from http://buildbot.twistedmatrix.com/) and looking at the "versions" log of the "report-module-versions" step.

comment:4 Changed 5 weeks ago by veggies

The attached patch isn't great; input_add gets called a *lot* (a simple benchmark I was running resulted in over 35,000 calls for 40,000 lines read from a socket) and importing gi is not something you want to be doing on each iteration of an inner loop (with profiling enabled, it was 2ms a pop--not cheap!).

Suggestion: move the import to the top of the file, or just say that twisted requires newish pygtk, as suggested above.

Note: See TracTickets for help on using tickets.