diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-03-17 11:39:28 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-03-18 12:49:44 -0700 |
commit | 7a4d48c09791118b4cfb39ebe7711b192603a466 (patch) | |
tree | 2c585af25c67bbfdc5f83665d463ec77143ed50d /pym | |
parent | 5c1e74b2d9a68eb97557c76859bcdc74675d03d7 (diff) | |
download | portage-7a4d48c09791118b4cfb39ebe7711b192603a466.tar.gz portage-7a4d48c09791118b4cfb39ebe7711b192603a466.tar.bz2 portage-7a4d48c09791118b4cfb39ebe7711b192603a466.zip |
dep_check: return errors as unicode
This should prevent the following error due to returning raw bytes,
reported in forum thread #869281:
File "pym/_emerge/BlockerDB.py", line 72, in findInstalledBlockers
portage.writemsg("!!! %s/*DEPEND: %s\n" % \
(pkg_location, atoms), noiselevel=-1)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in
position 23: ordinal not in range(128)
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/dep/dep_check.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 4d26f51f4..7ec01fa52 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -6,6 +6,7 @@ __all__ = ['dep_check', 'dep_eval', 'dep_wordreduce', 'dep_zapdeps'] import logging import portage +from portage import _unicode_decode from portage.dep import Atom, match_from_list, use_reduce from portage.exception import InvalidDependString, ParseError from portage.localization import _ @@ -173,8 +174,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", del mytrees["virt_parent"] if not mycheck[0]: - raise ParseError( - "%s: %s '%s'" % (pkg, mycheck[1], depstring)) + raise ParseError(_unicode_decode("%s: %s '%s'") % \ + (pkg, mycheck[1], depstring)) # pull in the new-style virtual mycheck[1].append(virt_atom) @@ -587,7 +588,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, matchall=(use=="all"), excludeall=useforce, opconvert=True, \ token_class=Atom, eapi=eapi) except InvalidDependString as e: - return [0, str(e)] + return [0, _unicode_decode("%s") % (e,)] if mysplit == []: #dependencies were reduced to nothing @@ -601,7 +602,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, use_force=useforce, use_mask=mymasks, use_cache=use_cache, use_binaries=use_binaries, myroot=myroot, trees=trees) except ParseError as e: - return [0, str(e)] + return [0, _unicode_decode("%s") % (e,)] mysplit2=mysplit[:] mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache) |