From: Zac Medico Date: Thu, 24 Sep 2009 06:03:58 +0000 (-0000) Subject: Decode directory names where appropriate in digestcheck(). Thanks to X-Git-Tag: v2.2_rc42~25 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ff4638539b575aec08bd042ee40565c21d9df235;p=portage.git Decode directory names where appropriate in digestcheck(). Thanks to Arfrever for reporting. svn path=/main/trunk/; revision=14399 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 8e6811ffd..7909a403e 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5357,6 +5357,20 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0): return 0 continue for d in dirs: + try: + d = _unicode_decode(d, + encoding=_encodings['fs'], errors='strict') + except UnicodeDecodeError: + d = _unicode_decode(d, + encoding=_encodings['fs'], errors='replace') + writemsg(_("!!! Path contains invalid " + "character(s) for encoding '%s': '%s'") \ + % (_encodings['fs'], os.path.join(parent, d)), + noiselevel=-1) + if strict: + return 0 + dirs.remove(d) + continue if d.startswith(".") or d == "CVS": dirs.remove(d) for f in files: