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 686619 - "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2: ordinal not in range(128)" in sessionsaver
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2: ordi...
Status: RESOLVED OBSOLETE
Product: gedit-plugins
Classification: Other
Component: General
3.4.x
Other Linux
: Normal major
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-22 10:04 UTC by Pietro Battiston
Modified: 2019-03-23 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch solving the UnicodeDecodeError (1.01 KB, patch)
2012-10-22 10:06 UTC, Pietro Battiston
accepted-commit_now Details | Review

Description Pietro Battiston 2012-10-22 10:04:51 UTC
That's what I get when I start gedit:

Traceback (most recent call last):
  • File "/usr/lib/gedit/plugins/sessionsaver/__init__.py", line 67 in do_activate
    self._insert_menu()
  • File "/usr/lib/gedit/plugins/sessionsaver/__init__.py", line 118 in _insert_menu
    self._update_session_menu()
  • File "/usr/lib/gedit/plugins/sessionsaver/__init__.py", line 84 in _update_session_menu
    _("Recover '%s' session") % session.name,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2: ordinal not in range(128)

I'll attach a patch solving the issue. Notice that I wasn't able to test on versions later than 3.4.0 (in Debian testing), but I did verify that that particular code is unchanged in trunk (the patch is against it).

See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686361 .
Comment 1 Pietro Battiston 2012-10-22 10:06:49 UTC
Created attachment 226978 [details] [review]
Patch solving the UnicodeDecodeError

This patch solves the problem for me.
Comment 2 Ignacio Casal Quinteiro (nacho) 2012-10-22 10:07:53 UTC
Review of attachment 226978 [details] [review]:

Looks good.
Comment 3 Zoltan P 2012-12-25 17:30:18 UTC
I'm having the exact same problem with Gedit 3.4.1 on Ubutunu 12.04. 

I've solved the issue by replacing line 86 in /usr/lib/gedit/plugins/sessionsaver/__init__.py from:

            action = Gtk.Action(action_name,
                                session.name,
                                _("Recover '%s' session") % session.name,
                                "")

to:

            action = Gtk.Action(action_name,
                                session.name,
                                _("Recover '%s' session").decode('utf8') % session.name,
                                "")
Comment 4 Zoltan P 2012-12-25 17:33:18 UTC
Review of attachment 226978 [details] [review]:

Tested, works fine.
Comment 5 Zoltan P 2012-12-25 17:34:08 UTC
I'm having the exact same problem with Gedit 3.4.1 on Ubutunu 12.04. 

I've solved the issue by replacing line 86 in /usr/lib/gedit/plugins/sessionsaver/__init__.py from:

            action = Gtk.Action(action_name,
                                session.name,
                                _("Recover '%s' session") % session.name,
                                "")

to:

            action = Gtk.Action(action_name,
                                session.name,
                                _("Recover '%s' session").decode('utf8') % session.name,
                                "")
Comment 6 Sébastien Wilmet 2013-02-24 16:24:44 UTC
The session saver plugin has been dropped:

http://git.gnome.org/browse/gedit-plugins/commit/?id=7abf46cf9c6e3f12798e813ffeac28e3594167f0
Comment 7 Pietro Battiston 2013-02-24 16:43:59 UTC
Wow. It's worthwhile to spend time catching a bug, submitting a patch, and then getting to know 4 months later that the plugin has been dropped since 2 month.

Is there any way (the commit message doesn't help) to know which bugs motivated the choice? Is there any chance that if those bugs are fixed the plugin will be reintroduced?

I ask because this plugin does work great for me (and anyway Debian will apparently include it).
Comment 8 Sébastien Wilmet 2013-02-24 20:36:51 UTC
See maybe the bug #616323.
Comment 9 Pietro Battiston 2013-02-24 20:56:38 UTC
Thanks Sébastien,
I did see that... I just assume it was not the reason because it did have a patch submitted (and no negative comments about its last version, or any hints of additional work needed before accepting it).
Comment 10 Benjamin Danon 2013-05-12 22:01:28 UTC
I'm working on the session saver plugin to restore it into the package gedit-plugins. Help is welcome :) https://github.com/sphax3d/gedit-sessionsaver