Snippets plugin Multibyte Error

Bug #1072776 reported by smeghead
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glipper
New
Undecided
Unassigned

Bug Description

if it exists that snippets plugin entry contains Multibyte string, failed to start glipper.
Error message is below.

Traceback (most recent call last):
  File "./scripts/glipper", line 43, in <module>
    glipper.AppIndicator.AppIndicator()
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/AppIndicator.py", line 53, in __init__
    get_glipper_plugins_manager().load()
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/PluginsManager.py", line 48, in load
    self.start(file_name)
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/PluginsManager.py", line 56, in start
    plugin.call('init')
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/Plugin.py", line 31, in call
    return apply(func, args)
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/plugins/snippets.py", line 118, in init
    update_menu()
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/plugins/snippets.py", line 133, in update_menu
    item = gtk.MenuItem(glipper.format_item(snippet))
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/__init__.py", line 127, in format_item
    return glipper.AppIndicator.format_item(item)
  File "/home/smeghead/Dropbox/work/glipper-snippets-multibyte/glipper/glipper/AppIndicator.py", line 189, in format_item
    return i[0:max_item_length/2] + u'\u2026' + i[-(max_item_length/2-3):]
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 15-16: unexpected end of data

The attachment file is a patch of my solution.

Revision history for this message
smeghead (smeghead7) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.