From ff4638539b575aec08bd042ee40565c21d9df235 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 24 Sep 2009 06:03:58 +0000 Subject: Decode directory names where appropriate in digestcheck(). Thanks to Arfrever for reporting. svn path=/main/trunk/; revision=14399 --- pym/portage/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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: -- cgit v1.2.3-1-g7c22