<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 27, 2018 at 5:52 AM Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 2018-06-22 at 02:07 +0500, Christopher Larson wrote:<br>
&gt; From: Christopher Larson &lt;<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>&gt;<br>
&gt; <br>
&gt; Rather than trying to construct a string by quoting the files in an<br>
&gt; error-prone way, parse $EDITOR to pass a list to subprocess rather<br>
&gt; than<br>
&gt; a string.<br>
&gt; <br>
&gt; Signed-off-by: Christopher Larson &lt;<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>&gt;<br>
&gt; ---<br>
&gt;  scripts/lib/scriptutils.py | 24 ++++++++++++------------<br>
&gt;  1 file changed, 12 insertions(+), 12 deletions(-)<br>
&gt; <br>
&gt; diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py<br>
&gt; index 85b1c949bf5..470f76995f0 100644<br>
&gt; --- a/scripts/lib/scriptutils.py<br>
&gt; +++ b/scripts/lib/scriptutils.py<br>
&gt; @@ -214,15 +215,14 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir,<br>
&gt; logger, preserve_tmp=False, mirr<br>
&gt;  <br>
&gt;  def run_editor(fn, logger=None):<br>
&gt;      if isinstance(fn, str):<br>
&gt; -        params = &#39;&quot;%s&quot;&#39; % fn<br>
&gt; +        files = [fn]<br>
&gt;      else:<br>
&gt; -        params = &#39;&#39;<br>
&gt; -        for fnitem in fn:<br>
&gt; -            params += &#39; &quot;%s&quot;&#39; % fnitem<br>
&gt; +        files = fn<br>
&gt;  <br>
&gt;      editor = os.getenv(&#39;VISUAL&#39;, os.getenv(&#39;EDITOR&#39;, &#39;vi&#39;))<br>
&gt;      try:<br>
&gt; -        return subprocess.check_call(&#39;%s %s&#39; % (editor, params), shell=True)<br>
&gt; +        print(shlex.split(editor) + files)<br>
&gt; +        return subprocess.check_call(shlex.split(editor) + files)<br>
&gt;      except subprocess.CalledProcessError as exc:<br>
&gt;          logger.error(&quot;Execution of &#39;%s&#39; failed: %s&quot; % (editor, exc))<br>
&gt;          return 1<br>
<br>
I&#39;m guessing you didn&#39;t mean to leave the print() above in?<br>
<br>
If the print is there, it breaks:<br>
<br>
&quot;oe-selftest -r devtool.DevtoolTests.test_devtool_add&quot;<br>
<br>
I can comment it out...<br clear="all"></blockquote><div><br></div><div class="">Yeah, that was a debug remnant, sorry about that. :\<br></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="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></div>