After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 335908 - Traceback trying to enter U+2022 with Shift+Ctrl in the Invisible Char entry
Traceback trying to enter U+2022 with Shift+Ctrl in the Invisible Char entry
Status: RESOLVED FIXED
Product: Gazpacho
Classification: Deprecated
Component: general
0.6.5
Other Linux
: Normal normal
: 0.6.6
Assigned To: Gazpacho Maintainer(s)
Gazpacho Maintainer(s)
: 340130 340131 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-03-24 22:53 UTC by Christopher Aillon
Modified: 2006-04-29 18:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (preliminary) (493 bytes, patch)
2006-03-25 11:05 UTC, Mattias Karlsson
none Details | Review
Patch (393 bytes, patch)
2006-03-27 19:53 UTC, Mattias Karlsson
committed Details | Review

Description Christopher Aillon 2006-03-24 22:53:55 UTC
/usr/lib/python2.4/site-packages/gazpacho/debugwindow.py:127: GtkWarning: gtk_te xt_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed
  self._buffer.insert_with_tags_by_name(end_iter, text, *tags)
gazpacho properties/nm-vpnc-dialog.glade  47.85s user 7.28s system 0% cpu 2:04:3 9.50 total


  File /usr/lib/python2.4/site-packages/gazpacho/editor.py, line 153, in _changed_unichar
    self.set(text[0])
  File /usr/lib/python2.4/site-packages/gazpacho/editor.py, line 91, in set
    command_manager.set_property(self.property, value)
  File /usr/lib/python2.4/site-packages/gazpacho/commandmanager.py, line 151, in set_property
    cmd.execute()
  File /usr/lib/python2.4/site-packages/gazpacho/command.py, line 385, in execute
    self._property.set(new_value)
  File /usr/lib/python2.4/site-packages/gazpacho/properties.py, line 643, in _set
    raise TypeError("Error while setting %s:%s to %s `%s'" % (
TypeError:
Comment 1 Mattias Karlsson 2006-03-25 11:00:34 UTC
Just a quick note about this bug (I haven't given it much thought so I can be missing something). The problem seems to be the following code:

    def _changed_unichar(self, entry):
        if self.property_loading:
            return

        text = entry.get_chars(0, -1)
        if text:
            self.set(text[0])

Since we are working with normal strings the unicode character will actually be stored as several characters. When doing a text[0] we will not get the unicode character but something else and in this case it seems to be invalid.
Comment 2 Mattias Karlsson 2006-03-25 11:05:59 UTC
Created attachment 61968 [details] [review]
Patch (preliminary)

I wrote a quick patch that seems to work on my system. Not sure if it assumes too much about the encoding?
Comment 3 Mattias Karlsson 2006-03-27 19:53:04 UTC
Created attachment 62152 [details] [review]
Patch

This patch should hopefully be correct. Changes:

* the encoding of the string will always be utf-8 in gtk (if I'm not mistaken)
* no need to encode the unicode string, it will be accepted as it is
Comment 4 Mattias Karlsson 2006-03-27 20:25:09 UTC
Patch committed (slightly modified)

Sending        ChangeLog
Sending        gazpacho/editor.py
Transmitting file data ..
Committed revision 2233.
Comment 5 Mattias Karlsson 2006-04-24 18:51:16 UTC
Setting correct milestone for bugs that have been fixed for the 0.6.6 release.
Comment 6 Mattias Karlsson 2006-04-29 18:31:24 UTC
*** Bug 340131 has been marked as a duplicate of this bug. ***
Comment 7 Mattias Karlsson 2006-04-29 18:33:12 UTC
*** Bug 340130 has been marked as a duplicate of this bug. ***