From 5f93ad8e308d00fc7a9b782cbe88efa26524dde7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 6 Dec 2009 11:00:46 +0000 Subject: [PATCH] Bug #295805 - Fix ValueError with python3 inside update_config_files(). (trunk r14929) svn path=/main/branches/2.1.7/; revision=14943 --- pym/portage/update.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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, -- 2.26.2