commit:     b5b83a9d022952b74fe3d8d97dd2986e00d5f540
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 11 19:51:52 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 12 21:16:10 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b5b83a9d

bintree: Drop Python 2 compat code

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Part-of: https://github.com/gentoo/portage/pull/1459
Closes: https://github.com/gentoo/portage/pull/1459
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/dbapi/bintree.py | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 91cf8968dc..a3505d1590 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1664,16 +1664,8 @@ class binarytree:
                         )
                         % (binrepo_name, _hide_url_passwd(base_url))
                     )
-                    # With Python 2, the EnvironmentError message may
-                    # contain bytes or unicode, so use str to ensure
-                    # safety with all locales (bug #532784).
-                    try:
-                        error_msg = str(e)
-                    except UnicodeDecodeError as uerror:
-                        error_msg = str(
-                            uerror.object, encoding="utf_8", errors="replace"
-                        )
-                    writemsg(f"!!! [${binrepo_name}] {error_msg}\n\n")
+                    error_msg = str(e)
+                    writemsg(f"!!!{binrepo_name} {error_msg}\n\n")
                     del e
                     pkgindex = None
                 finally:

Reply via email to