← Back to team overview

desktop-packages team mailing list archive

[Bug 588694] Re: null-ok parameter annotation not correctly handled for virtual methods

 

lucid has seen the end of its life and is no longer receiving any
updates. Marking the lucid task for this ticket as "Won't Fix".

** Changed in: pygobject (Ubuntu Lucid)
       Status: Triaged => Won't Fix

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to pygobject in Ubuntu.
https://bugs.launchpad.net/bugs/588694

Title:
  null-ok parameter annotation not correctly handled for virtual methods

Status in Python bindings for GObject:
  Fix Released
Status in pygobject package in Ubuntu:
  Fix Released
Status in pygobject source package in Lucid:
  Won't Fix

Bug description:
  Steps to reproduce:
  1. Create a Python class which implement an interface which contains a method
  with null-ok string parameter (gtk.Buildable.add_child)
  2. Call this method from C with a null parameter (or use gtk.Builder in our
  case)
  3. application crashes with a segfault in the corresponding proxy method.

  
  Test case:
  1. Use upstream head Rhythmbox, or lucid Rhythmbox with patch from https://bugzilla.gnome.org/show_bug.cgi?id=619677, so that impl_add_uri and impl_want_uri RB functions are exposed to RB Python plugins
  2. Add a trivial Python plugin that implements do_impl_{want,add}_uri
  3. Run "rhythmbox testurl:///whatever" from the command line
  4. Rhythmbox segfaults.

  
  Code for example trivial Python plugin:

  
  import rb, gobject
  class ExampleURI(rb.Plugin):
      def activate(self, shell):
          self.source = gobject.new(MySource, shell=shell,plugin=self)
      def deactivate(self, shell):
          self.source.delete_thyself()
  class MySource(rb.Source):
      __gproperties__ = {
        'plugin': (rb.Plugin, 'plugin', 'plugin', 
                      gobject.PARAM_WRITABLE|gobject.PARAM_CONSTRUCT_ONLY),
      }
      def do_impl_want_uri(self, uri):
          if uri.startswith("testuri://"): return 100
          rb.Source.do_impl_want_uri(self, uri)
          return 0
      def do_impl_add_uri(self, uri, title, genre):
          if not uri.startswith("testuri://"): return False
          print "Hi! The testcase plugin got a uri: %s" % uri
          return True

To manage notifications about this bug go to:
https://bugs.launchpad.net/pygobject/+bug/588694/+subscriptions