<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, <<a href="mailto:ankur.tyagi85@gmail.com">ankur.tyagi85@gmail.com</a>> 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 = ''<br>
pswd = ''<br>
<br>
+ if type not in ['git']:<br>
+ path = urllib.parse.unquote(path)<br>
+<br>
p = collections.OrderedDict()<br>
if parm:<br>
for s in parm.split(';'):<br>
@@ -389,7 +392,7 @@ def decodeurl(url):<br>
s1, s2 = s.split('=')<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>
"""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 <<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> Previous idea is stupid, please discard that.<br>
> Just checked quote/unquote were added as part of commit<br>
> b1dbc24ebcc4e5100c32568c2c41fd982fb4bcce<br>
><br>
> So explaining the situation again --> when fecthing from repo url<br>
> <a href="https://tfs.local/repos/foo%bar" rel="noreferrer noreferrer" target="_blank">https://tfs.local/repos/foo%bar</a><br>
><br>
> During FetchData initialization, decodeurl(d.expand(url)) returns path<br>
> with %20 stripped<br>
><br>
> [log][__init__][decodeurl] Path returned /repos/foo bar<br>
><br>
> And when git method urldata_init() is called, it sets gitsrcname with<br>
> space instead of %20<br>
><br>
> [log][git][urldata_init] gitsrcname is tfs.local.repos.foo bar<br>
><br>
> And when git method _get_repo_url is called, it always returns Path<br>
> with space instead of %20<br>
><br>
> [log][git][_get_repo_url] Path returned /repos/foo bar<br>
><br>
> So I am bit confused now on how to handle it properly as unquote is<br>
> removing %20 and it cannot be added back in later stage.<br>
><br>
> Regards<br>
> Ankur<br>
><br>
><br>
> On Thu, Jul 25, 2019 at 7:23 PM Ankur Tyagi <<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>> wrote:<br>
> ><br>
> > Hi,<br>
> ><br>
> > Sorry for the late reply but I have figured out where %20 is being stripped out.<br>
> ><br>
> > File lib/bb/fetch2/__init__.py, method decodeurl(url) is returning<br>
> > path as urllib.parse.unquote(path) which strips out %20<br>
> > So if I return path as it is, then %20 is preserved and works as expected.<br>
> ><br>
> > diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py<br>
> > index f6b5529b..97fd59e1 100644<br>
> > --- a/lib/bb/fetch2/__init__.py<br>
> > +++ b/lib/bb/fetch2/__init__.py<br>
> > @@ -389,7 +389,7 @@ def decodeurl(url):<br>
> > s1, s2 = s.split('=')<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>
> ><br>
> > Is above change acceptable?<br>
> ><br>
> > Regards<br>
> > Ankur<br>
> ><br>
> > On Wed, Jul 10, 2019 at 4:33 AM Richard Purdie<br>
> > <<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank" rel="noreferrer">richard.purdie@linuxfoundation.org</a>> wrote:<br>
> > ><br>
> > > On Wed, 2019-07-10 at 21:26 +1200, Ankur Tyagi wrote:<br>
> > > > Hi,<br>
> > > ><br>
> > > > Is there something else that needs to be done in this patch? Or<br>
> > > > perhaps there is a better to handle this?<br>
> > > > I am willing to learn and try it out if original patch is not good.<br>
> > ><br>
> > > I think Mark is right, we need to figure out where the %20 characters<br>
> > > are being stripped out and preserve them rather than injecting them<br>
> > > back in again.<br>
> > ><br>
> > > The question is therefore where they're being stripped out in the code?<br>
> > ><br>
> > > Cheers,<br>
> > ><br>
> > > Richard<br>
> > ><br>
</blockquote></div></div></div>