Patchwork [bitbake-devel,2/4] fetch2: Fix URI encode / decode regression

mail settings
Submitter Jason Wessel
Date June 14, 2012, 3:09 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/29805/
State New
Headers show


Jason Wessel - June 14, 2012, 3:09 a.m.
The commit 420eb112a4f (fetch2: quote/unquote url paths) caused a
regression on Ubuntu 11.10's default python.

The problem is a result of the uri_replace() returning an encoded uri
and the's localpath() routine not decoding the uri before
executing the local checks.

The problem was found using an updated version of the screen patches where there is a local copy of the download.  Example:

| DEBUG: For url;name=patch returning file:///opt/dl/downloads/screen_4.0.3-11%2Blenny1.diff.gz;name=patch

The %2B was not getting decoded by the localpath() routine.

Signed-off-by: Jason Wessel <>
 lib/bb/fetch2/ |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


diff --git a/lib/bb/fetch2/ b/lib/bb/fetch2/
index a0ed444..fdbd9fc 100644
--- a/lib/bb/fetch2/
+++ b/lib/bb/fetch2/
@@ -43,10 +43,12 @@  class Local(FetchMethod):
         ud.basename = os.path.basename(ud.url.split("://")[1].split(";")[0])
-    def localpath(self, url, urldata, d):
+    def localpath(self, tryurl, urldata, d):
         Return the local filename of a given url assuming a successful fetch.
+        import urllib;
+        url = urllib.unquote(tryurl)
         path = url.split("://")[1]
         path = path.split(";")[0]
         newpath = path