<div dir="ltr">This doesn&#39;t escape the filename, it quotes it, so should probably correct the message, and will almost certainly break if the name contains a single quote. I&#39;d suggest using subprocess.list2cmdline(), pipes.quote(), or similar instead of doing it manually. Definitely a good fix, just likely best done with an existing mechanism :) Thanks for the contribution.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 17, 2020 at 9:52 AM Jean-Marie LEMETAYER &lt;<a href="mailto:jean-marie.lemetayer@savoirfairelinux.com">jean-marie.lemetayer@savoirfairelinux.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">When using a download filename with characters which can be interpreted<br>
by the shell (&#39;(&#39;, &#39;)&#39;, &#39;&amp;&#39;, &#39;;&#39;, ...) the command fails. Escaping the<br>
filename fixes the issue.<br>
<br>
Signed-off-by: Jean-Marie LEMETAYER &lt;<a href="mailto:jean-marie.lemetayer@savoirfairelinux.com" target="_blank">jean-marie.lemetayer@savoirfairelinux.com</a>&gt;<br>
---<br>
 lib/bb/fetch2/wget.py | 6 +++---<br>
 1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py<br>
index 725586d2..6506e1e2 100644<br>
--- a/lib/bb/fetch2/wget.py<br>
+++ b/lib/bb/fetch2/wget.py<br>
@@ -94,9 +94,9 @@ class Wget(FetchMethod):<br>
         fetchcmd = self.basecmd<br>
<br>
         if &#39;downloadfilename&#39; in ud.parm:<br>
-            dldir = d.getVar(&quot;DL_DIR&quot;)<br>
-            bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))<br>
-            fetchcmd += &quot; -O &quot; + dldir + os.sep + ud.localfile<br>
+            localpath = os.path.join(d.getVar(&quot;DL_DIR&quot;), ud.localfile)<br>
+            bb.utils.mkdirhier(os.path.dirname(localpath))<br>
+            fetchcmd += &quot; -O &#39;%s&#39;&quot; % localpath<br>
<br>
         if ud.user and ud.pswd:<br>
             fetchcmd += &quot; --user=%s --password=%s --auth-no-challenge&quot; % (ud.user, ud.pswd)<br>
-- <br>
2.20.1<br>
<br>
-- <br>
_______________________________________________<br>
bitbake-devel mailing list<br>
<a href="mailto:bitbake-devel@lists.openembedded.org" target="_blank">bitbake-devel@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/bitbake-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/bitbake-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>