mate-desktop / mozo

Menu editor for MATE using the freedesktop.org menu specification
http://www.mate-desktop.org
GNU Lesser General Public License v2.1
28 stars 12 forks source link

Moving or hiding non-ascii characters fail #26

Closed vendelin8 closed 8 years ago

vendelin8 commented 8 years ago

When I move a menu item elsewhere, or try to hide it, if it has a accented character, the whole application menu disappears.

/usr/lib/python2.7/dist-packages/Mozo/MainWindow.py:86: Warning: Source ID 3535 was not found when attempting to remove it GLib.Source.remove(self.timer) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/Mozo/MainWindow.py", line 430, in on_menu_tree_drag_data_received self.editor.copyItem(item, newparent) File "/usr/lib/python2.7/dist-packages/Mozo/MenuEditor.py", line 298, in copyItem self.save() File "/usr/lib/python2.7/dist-packages/Mozo/MenuEditor.py", line 68, in save fd.write(re.sub("\n[\s]([^\n<]_)\n[\s]*</", "\1</", getattr(self, menu).dom.toprettyxml().replace('<?xml version="1.0" ?>\n', ''))) File "/usr/lib/python2.7/xml/dom/minidom.py", line 61, in toprettyxml return writer.getvalue() File "/usr/lib/python2.7/StringIO.py", line 271, in getvalue self.buf += ''.join(self.buflist) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 11: ordinal not in range(128)

Ryuno-Ki commented 8 years ago

The stack trace would be way more readble when put into a code fence.

@vendelin8 Which version you are using?

vendelin8 commented 8 years ago

@Ryuno-Ki 1.14.0-1

XRevan86 commented 8 years ago

Duplicate of #29.