From: Zac Medico Date: Sun, 6 Dec 2009 11:00:46 +0000 (-0000) Subject: Bug #295805 - Fix ValueError with python3 inside update_config_files(). X-Git-Tag: v2.1.7.11~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5f93ad8e308d00fc7a9b782cbe88efa26524dde7;p=portage.git Bug #295805 - Fix ValueError with python3 inside update_config_files(). (trunk r14929) svn path=/main/branches/2.1.7/; revision=14943 --- diff --git a/pym/portage/update.py b/pym/portage/update.py index 04812d5a4..af0fd2f42 100644 --- a/pym/portage/update.py +++ b/pym/portage/update.py @@ -201,15 +201,20 @@ def update_config_files(config_root, protect, protect_mask, update_iter): config_file = os.path.join(abs_user_config, x) if os.path.isdir(config_file): for parent, dirs, files in os.walk(config_file): - for y in dirs: + try: + parent = _unicode_decode(parent, + encoding=_encodings['fs'], errors='strict') + except UnicodeDecodeError: + continue + for y_enc in dirs: try: - y = _unicode_decode(y, + y = _unicode_decode(y_enc, encoding=_encodings['fs'], errors='strict') except UnicodeDecodeError: - dirs.remove(y) + dirs.remove(y_enc) continue if y.startswith("."): - dirs.remove(y) + dirs.remove(y_enc) for y in files: try: y = _unicode_decode(y,