diff mbox series

fetch2/sftp: Fix fetching URIs with spaces

Message ID 20230317170354.971113-1-daniel.ammann@bytesatwork.ch
State Accepted, archived
Commit 0f887589c279ce07692b4d8e118954a9d214ca45
Headers show
Series fetch2/sftp: Fix fetching URIs with spaces | expand

Commit Message

Daniel Ammann March 17, 2023, 5:03 p.m. UTC
Spaces can be used in URIs with %20, but the URI needs to be quoted.

Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch>
---
 lib/bb/fetch2/sftp.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/sftp.py b/lib/bb/fetch2/sftp.py
index f87f292e5..7884cce94 100644
--- a/lib/bb/fetch2/sftp.py
+++ b/lib/bb/fetch2/sftp.py
@@ -103,7 +103,7 @@  class SFTP(FetchMethod):
         if path[:3] == '/~/':
             path = path[3:]
 
-        remote = '%s%s:%s' % (user, urlo.hostname, path)
+        remote = '"%s%s:%s"' % (user, urlo.hostname, path)
 
         cmd = '%s %s %s %s' % (basecmd, port, remote, lpath)