Skip to content
  1. Oct 13, 2017
  2. Feb 19, 2013
  3. Mar 12, 2012
  4. Feb 21, 2012
  5. Sep 07, 2011
  6. Aug 15, 2011
  7. Jul 14, 2011
  8. Jul 13, 2011
  9. Jul 08, 2011
  10. Jul 07, 2011
    • Martin Pitt's avatar
      Fix crash in Gtk.TextIter overrides · e114c3de
      Martin Pitt authored
      With commit 17cd0fb3 Gtk.TextIter.{forward,backward}_search() returns undefined
      pointers when the search was unsuccessful. Actually check the "success" return
      value; if it is False return None, just like PyGTK used to.
      
      Thanks to Michael Vogt for discovering this and writing the test case!
      
      Test case:
      
      -------------- 8< -----------------
      from gi.repository import Gtk
      
      win = Gtk.Window.new(Gtk.WindowType.TOPLEVEL)
      textview = Gtk.TextView()
      buffer = textview.get_buffer()
      buffer.set_text("hello world")
      win.add(textview)
      
      win.show_all()
      
      iter = buffer.get_start_iter()
      end = buffer.get_end_iter()
      ret = iter.forward_search("foo",
                                Gtk.TextSearchFlags.VISIBLE_ONLY,
      			                            end)
      print "this is my return value"
      print ret
      print "now I crash"
      print ret[0].get_offset()
      
      Gtk.main()
      -------------- 8< -----------------
      e114c3de
  11. Jul 01, 2011
  12. Jun 28, 2011
  13. Jun 27, 2011
  14. Jun 13, 2011
  15. Jun 11, 2011
  16. Jun 10, 2011
  17. Jun 08, 2011
  18. Jun 06, 2011
    • Daniel Drake's avatar
      Fix GC-related crash during PyGObject deallocation · eca590a3
      Daniel Drake authored
      Python-2.7.1's GC source has the following comment:
      
              /* Python's cyclic gc should never see an incoming refcount
               * of 0:  if something decref'ed to 0, it should have been
               * deallocated immediately at that time.
               * Possible cause (if the assert triggers):  a tp_dealloc
               * routine left a gc-aware object tracked during its teardown
               * phase, and did something-- or allowed something to happen --
               * that called back into Python.  gc can trigger then, and may
               * see the still-tracked dying object.  Before this assert
               * was added, such mistakes went on to allow gc to try to
               * delete the object again.  In a debug build, that caused
               * a mysterious segfault, when _Py_ForgetReference tried
               * to remove the object from the doubly-linked list of all
               * objects a second time.  In a release build, an actual
               * double deallocation occurred, which leads to corruption
               * of the allocator's internal bookkeeping pointers.  That's
               * so serious that maybe this should be a release-build
               * check instead of an assert?
               */
      
      As shown in a backtrace at
      https://bugzilla.redhat.com/show_bug.cgi?id=640972 , pygobject is making
      this exact mistake. Before untracking its object, pygobject_dealloc
      calls PyObject_ClearWeakRefs() which can call back into python, create
      new allocations, and trigger the GC.
      
      This is causing Sugar (based on pygobject2 + pygtk2 static bindings) to
      crash on a regular basis while interacting with widgets or launching
      applications.
      
      Fix this by untracking the object early. Also fix the same issue spotted
      in the GSource wrapper.
      
      Thanks to Bernie Innocenti for initial diagnosis.
      eca590a3
  19. May 05, 2011
    • Martin Pitt's avatar
      Fix symbol names to be locale independent · ad96a3f1
      Martin Pitt authored
      We currently use upper() to present enum values, which are usually defined in
      lower case in the typelib, in upper cases. However, upper() is locale
      dependent, so that e. g. in tr_TR.UTF-8, "invalid" becomes "iNVALiD"
      because Turkish has some extra variants of "i".
      
      Use a local ASCII-only translate() call instead to avoid this. Thanks to Nils
      Philippsen for the idea!
      
      This also adds a test locale "te_ST@nouppera" which defines toupper('a') == 'a'.
      Run the Enum tests under this locale to reproduce the bug and verify the fix.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=649165
      ad96a3f1
  20. Apr 18, 2011
  21. Apr 16, 2011
  22. Apr 15, 2011
  23. Apr 11, 2011
  24. Apr 08, 2011
    • Steve Frécinaux's avatar
      Fix ABI break in old static bindings. · cc0e8423
      Steve Frécinaux authored
      Commit 84d6142c (Always register a new
      GType when a GObject class is subclassed) breaks the more advanced usage
      of PyGObject with regards to "metaclass hackery" as used in for example
      the kiwi and sqlkit projects. But the users of the gi-based bindings
      now rely on the new behaviour.
      
      We fix this by restraining the systematical registering of new types to
      the new gi-based bindings, leaving the old pygtk ones untouched.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=646437
      cc0e8423
  25. Apr 04, 2011
  26. Mar 24, 2011