diff mbox series

[RFC,03/15] fetch2: remove unnecessary unquote

Message ID 20250205071538.2681-4-stefan.herbrechtsmeier-oss@weidmueller.com
State New
Headers show
Series Make mirror replacement syntax explicit | expand

Commit Message

Stefan Herbrechtsmeier Feb. 5, 2025, 7:15 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

The URI path is already unquoted. Remove the unnecessary unquote
function calls for URI path values.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
---

 lib/bb/fetch2/gcp.py  | 2 +-
 lib/bb/fetch2/s3.py   | 2 +-
 lib/bb/fetch2/sftp.py | 2 +-
 lib/bb/fetch2/wget.py | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/gcp.py b/lib/bb/fetch2/gcp.py
index 268267b7a..86546d40b 100644
--- a/lib/bb/fetch2/gcp.py
+++ b/lib/bb/fetch2/gcp.py
@@ -46,7 +46,7 @@  class GCP(FetchMethod):
         else:
             ud.basename = os.path.basename(ud.path)
 
-        ud.localfile = urllib.parse.unquote(ud.basename)
+        ud.localfile = ud.basename
 
     def get_gcp_client(self):
         from google.cloud import storage
diff --git a/lib/bb/fetch2/s3.py b/lib/bb/fetch2/s3.py
index fa5292dfd..22c053813 100644
--- a/lib/bb/fetch2/s3.py
+++ b/lib/bb/fetch2/s3.py
@@ -77,7 +77,7 @@  class S3(FetchMethod):
         else:
             ud.basename = os.path.basename(ud.path)
 
-        ud.localfile = urllib.parse.unquote(ud.basename)
+        ud.localfile = ud.basename
 
         ud.basecmd = d.getVar("FETCHCMD_s3") or "/usr/bin/env aws s3"
 
diff --git a/lib/bb/fetch2/sftp.py b/lib/bb/fetch2/sftp.py
index 45b6afb4a..bee71a0d0 100644
--- a/lib/bb/fetch2/sftp.py
+++ b/lib/bb/fetch2/sftp.py
@@ -77,7 +77,7 @@  class SFTP(FetchMethod):
         else:
             ud.basename = os.path.basename(ud.path)
 
-        ud.localfile = urllib.parse.unquote(ud.basename)
+        ud.localfile = ud.basename
 
     def download(self, ud, d):
         """Fetch urls"""
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 7066d5e2c..6cb728ab4 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -78,9 +78,9 @@  class Wget(FetchMethod):
         else:
             ud.basename = os.path.basename(ud.path)
 
-        ud.localfile = urllib.parse.unquote(ud.basename)
+        ud.localfile = ud.basename
         if not ud.localfile:
-            ud.localfile = urllib.parse.unquote(ud.host + ud.path).replace("/", ".")
+            ud.localfile = ud.host + ud.path.replace("/", ".")
 
         self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 100"