vardbapi: unicode safe UnpicklingError message
authorZac Medico <zmedico@gentoo.org>
Tue, 30 Nov 2010 20:19:13 +0000 (12:19 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 4 Dec 2010 06:27:39 +0000 (22:27 -0800)
Thanks to Fabio Erculiani <lxnay@gentoo.org> for reporting a
UnicodeDecodeError here.

pym/portage/dbapi/vartree.py

index 29e54ba6917b45f71994db334b4f8dbe7d8b5d9a..d386880f418eb0146a82e4a103f3ca54561221b9 100644 (file)
@@ -481,8 +481,8 @@ class vardbapi(dbapi):
                        del f
                except (IOError, OSError, EOFError, ValueError, pickle.UnpicklingError) as e:
                        if isinstance(e, pickle.UnpicklingError):
-                               writemsg(_("!!! Error loading '%s': %s\n") % \
-                                       (self._aux_cache_filename, str(e)), noiselevel=-1)
+                               writemsg(_unicode_decode(_("!!! Error loading '%s': %s\n")) % \
+                                       (self._aux_cache_filename, e), noiselevel=-1)
                        del e
 
                if not aux_cache or \