GNOME Bugzilla – Bug 690329
Can't call a Gtk.UIManager.add_ui_from_string() containing (too much) non-ASCII characters
Last modified: 2013-01-01 10:49:47 UTC
Created attachment 231703 [details] Show case for the bug Launching the attached file using Python 3 generates the following output: $ python3 test-uimanager-unicode.py 1 2 Traceback (most recent call last):
+ Trace 231298
u.add_ui_from_string(ui % "éé")
return Gtk.UIManager.add_ui_from_string(self, buffer, length)
return info.invoke(*args, **kwargs)
It doesn't cause this problem with Python 2, unless I decode the string first from UTF-8 and pass a Unicode string to add_ui_from_string() Note that it fails with "several" non-ASCII characters, but works with only one non-ASCII characters. I get the problem on Debian Sid, running python 3.2.3-6, python3-gi 3.3.91-1, but I got the problem originally from this bug report: https://github.com/multani/sonata/issues/27 (ArchLinux, different versions of the libraries).
Created attachment 232260 [details] Show case for the bug Simpler show case
Created attachment 232261 [details] GDB Session whiich shows the problem related to length
Created attachment 232262 [details] [review] Proposed fix
Thanks! Applied with a test case in http://git.gnome.org/browse/pygobject/commit/?id=948dbcb223249a08f4398d4ad8861e92e3de0dfa
*** Bug 690921 has been marked as a duplicate of this bug. ***
Thanks! I searched in the bug list on add_ui_from_string, but did not see this one. It is somewhat annoying the version here says only Version: 3.3.x What does that mean for the version in which this fix will be?
Benny, 3.3.x is the version that the OP was using when he reported it. Unlike Mantis, Gnome's Bugzilla doesn't record the version in which it was fixed. The commit was made to pygobject master and not backported, so it will go in the next unstable release (3.7.4) on the 14th and the eventual stable release (3.8.0) on 25 March. See https://live.gnome.org/ThreePointSeven for the release schedule.
This patch is backportable to 3.6 in principle, but as far as I can see on https://live.gnome.org/ThreePointSeven there is no further GNOME 3.6.3 release planned.