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>
Tue, 30 Nov 2010 20:19:13 +0000 (12:19 -0800)
Thanks to Fabio Erculiani <lxnay@gentoo.org> for reporting a
UnicodeDecodeError here.

pym/portage/dbapi/vartree.py

index fe32626554ef586981f39dd320aca826199b399f..e6e2de6a67e9f174b26d0539256f3a6d45319143 100644 (file)
@@ -482,8 +482,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 \