<div dir="auto"><div>Hi Richard,</div><div dir="auto"><br></div><div dir="auto">Any input on how it should be handled? I have identified the area like you asked and some ways to fix it as well</div><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto">Ankur<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sun, 28 Jul 2019, 9:15 p.m. Ankur Tyagi, &lt;<a href="mailto:ankur.tyagi85@gmail.com">ankur.tyagi85@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How about something like this:<br>
<br>
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py<br>
index f6b5529b..fa1f9e27 100644<br>
--- a/lib/bb/fetch2/__init__.py<br>
+++ b/lib/bb/fetch2/__init__.py<br>
@@ -380,6 +380,9 @@ def decodeurl(url):<br>
         user = &#39;&#39;<br>
         pswd = &#39;&#39;<br>
<br>
+    if type not in [&#39;git&#39;]:<br>
+        path = urllib.parse.unquote(path)<br>
+<br>
     p = collections.OrderedDict()<br>
     if parm:<br>
         for s in parm.split(&#39;;&#39;):<br>
@@ -389,7 +392,7 @@ def decodeurl(url):<br>
                 s1, s2 = s.split(&#39;=&#39;)<br>
                 p[s1] = s2<br>
<br>
-    return type, host, urllib.parse.unquote(path), user, pswd, p<br>
+    return type, host, path, user, pswd, p<br>
<br>
 def encodeurl(decoded):<br>
     &quot;&quot;&quot;Encodes a URL from tokens (scheme, network location, path,<br>
<br>
regards<br>
Ankur<br>
<br>
On Fri, Jul 26, 2019 at 3:13 PM Ankur Tyagi &lt;<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; Previous idea is stupid, please discard that.<br>
&gt; Just checked quote/unquote were added as part of commit<br>
&gt; b1dbc24ebcc4e5100c32568c2c41fd982fb4bcce<br>
&gt;<br>
&gt; So explaining the situation again --&gt; when fecthing from repo url<br>
&gt; <a href="https://tfs.local/repos/foo%bar" rel="noreferrer noreferrer" target="_blank">https://tfs.local/repos/foo%bar</a><br>
&gt;<br>
&gt; During FetchData initialization, decodeurl(d.expand(url)) returns path<br>
&gt; with %20 stripped<br>
&gt;<br>
&gt; [log][__init__][decodeurl] Path returned /repos/foo bar<br>
&gt;<br>
&gt; And when git method urldata_init() is called, it sets gitsrcname with<br>
&gt; space instead of %20<br>
&gt;<br>
&gt; [log][git][urldata_init] gitsrcname is tfs.local.repos.foo bar<br>
&gt;<br>
&gt; And when git method _get_repo_url is called, it always returns Path<br>
&gt; with space instead of %20<br>
&gt;<br>
&gt; [log][git][_get_repo_url] Path returned /repos/foo bar<br>
&gt;<br>
&gt; So I am bit confused now on how to handle it properly as unquote is<br>
&gt; removing %20 and it cannot be added back in later stage.<br>
&gt;<br>
&gt; Regards<br>
&gt; Ankur<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Jul 25, 2019 at 7:23 PM Ankur Tyagi &lt;<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; Sorry for the late reply but I have figured out where %20 is being stripped out.<br>
&gt; &gt;<br>
&gt; &gt; File lib/bb/fetch2/__init__.py, method decodeurl(url) is returning<br>
&gt; &gt; path as urllib.parse.unquote(path) which strips out %20<br>
&gt; &gt; So if I return path as it is, then %20 is preserved and works as expected.<br>
&gt; &gt;<br>
&gt; &gt; diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py<br>
&gt; &gt; index f6b5529b..97fd59e1 100644<br>
&gt; &gt; --- a/lib/bb/fetch2/__init__.py<br>
&gt; &gt; +++ b/lib/bb/fetch2/__init__.py<br>
&gt; &gt; @@ -389,7 +389,7 @@ def decodeurl(url):<br>
&gt; &gt;                  s1, s2 = s.split(&#39;=&#39;)<br>
&gt; &gt;                  p[s1] = s2<br>
&gt; &gt;<br>
&gt; &gt; -    return type, host, urllib.parse.unquote(path), user, pswd, p<br>
&gt; &gt; +    return type, host, path, user, pswd, p<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Is above change acceptable?<br>
&gt; &gt;<br>
&gt; &gt; Regards<br>
&gt; &gt; Ankur<br>
&gt; &gt;<br>
&gt; &gt; On Wed, Jul 10, 2019 at 4:33 AM Richard Purdie<br>
&gt; &gt; &lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank" rel="noreferrer">richard.purdie@linuxfoundation.org</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Wed, 2019-07-10 at 21:26 +1200, Ankur Tyagi wrote:<br>
&gt; &gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Is there something else that needs to be done in this patch? Or<br>
&gt; &gt; &gt; &gt; perhaps there is a better to handle this?<br>
&gt; &gt; &gt; &gt; I am willing to learn and try it out if original patch is not good.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I think Mark is right, we need to figure out where the %20 characters<br>
&gt; &gt; &gt; are being stripped out and preserve them rather than injecting them<br>
&gt; &gt; &gt; back in again.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The question is therefore where they&#39;re being stripped out in the code?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Cheers,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Richard<br>
&gt; &gt; &gt;<br>
</blockquote></div></div></div>