From 31081956871ec6e2818e0709cb71b65559fc4648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dautheribes?= Date: Thu, 12 Sep 2024 11:53:11 +0200 Subject: [PATCH] TransRead: support FTP authentication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far, we have assumed that user authentication is only relevant for HTTP(S). But the urllib module used to support HTTP authentication also supports FTP authentication. HTTP authentication requires more steps than FTP to work, so let just skip HTTP-specific steps for FTP authentication. Signed-off-by: Jérémie Dautheribes --- src/bmaptool/TransRead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bmaptool/TransRead.py b/src/bmaptool/TransRead.py index 194a18f..c35e033 100644 --- a/src/bmaptool/TransRead.py +++ b/src/bmaptool/TransRead.py @@ -607,7 +607,7 @@ def _print_warning(timeout): except netrc.NetrcParseError as e: _log.error(f"Error parsing line {e.lineno} of {e.filename}: {e.msg}") - if username and password: + if username and password and parsed_url.scheme in ("http", "https"): # Unfortunately, in order to handle URLs which contain username # and password (e.g., http://user:password@my.site.org), we need to # do few extra things.