summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-22 23:39:03 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-22 23:39:03 +0000
commit354f87f6aacc49c3a958cfa383ecd13cca2b6c19 (patch)
tree52be45d9bf0b1b8ba3b3fd2b5a9b53600965b7d2
parent3b5e6f3e4706be9a4e970af81a2222c389a3d1dc (diff)
downloadportage-354f87f6aacc49c3a958cfa383ecd13cca2b6c19.tar.gz
portage-354f87f6aacc49c3a958cfa383ecd13cca2b6c19.tar.bz2
portage-354f87f6aacc49c3a958cfa383ecd13cca2b6c19.zip
When decoding term codes inside the JobStatusDisplay constructor, use the
'replace' error handling scheme in order to avoid triggering a potential UnicodeError. svn path=/main/trunk/; revision=12687
-rw-r--r--pym/_emerge/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 9120e71b5..3b20718b1 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -9638,9 +9638,10 @@ class JobStatusDisplay(object):
for k, capname in self._termcap_name_map.iteritems():
term_codes[k] = self._default_term_codes[capname]
object.__setattr__(self, "_term_codes", term_codes)
+ encoding = sys.getdefaultencoding()
for k, v in self._term_codes.items():
if not isinstance(v, str):
- self._term_codes[k] = v.decode()
+ self._term_codes[k] = v.decode(encoding, 'replace')
def _init_term(self):
"""