commit:     6e587c1c8c05771644a9bc55b950dab294e62e18
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  2 09:14:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov  3 15:59:13 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e587c1c

bintree: Do not use urlopen() when URL scheme is ssh

Python's urllib does not support ssh, so there is no need to try it.

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

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

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 47b46064dc..257343edf8 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1455,8 +1455,10 @@ class binarytree:
                     # Don't use urlopen for https, unless
                     # PEP 476 is supported (bug #469888).
                     if (
-                        repo.fetchcommand is None or parsed_url.scheme in ("", 
"file")
-                    ) and (parsed_url.scheme not in ("https",) or 
_have_pep_476()):
+                        (repo.fetchcommand is None or parsed_url.scheme in 
("", "file"))
+                        and (parsed_url.scheme not in ("https",) or 
_have_pep_476())
+                        and (parsed_url.scheme not in ("ssh",))
+                    ):
                         try:
                             if parsed_url.scheme in ("", "file"):
                                 f = open(

Reply via email to