<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 27, 2018 at 5:52 AM Richard Purdie <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>> 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>
> From: Christopher Larson <<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>><br>
> <br>
> Rather than trying to construct a string by quoting the files in an<br>
> error-prone way, parse $EDITOR to pass a list to subprocess rather<br>
> than<br>
> a string.<br>
> <br>
> Signed-off-by: Christopher Larson <<a href="mailto:chris_larson@mentor.com" target="_blank">chris_larson@mentor.com</a>><br>
> ---<br>
> scripts/lib/scriptutils.py | 24 ++++++++++++------------<br>
> 1 file changed, 12 insertions(+), 12 deletions(-)<br>
> <br>
> diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py<br>
> index 85b1c949bf5..470f76995f0 100644<br>
> --- a/scripts/lib/scriptutils.py<br>
> +++ b/scripts/lib/scriptutils.py<br>
> @@ -214,15 +215,14 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir,<br>
> logger, preserve_tmp=False, mirr<br>
> <br>
> def run_editor(fn, logger=None):<br>
> if isinstance(fn, str):<br>
> - params = '"%s"' % fn<br>
> + files = [fn]<br>
> else:<br>
> - params = ''<br>
> - for fnitem in fn:<br>
> - params += ' "%s"' % fnitem<br>
> + files = fn<br>
> <br>
> editor = os.getenv('VISUAL', os.getenv('EDITOR', 'vi'))<br>
> try:<br>
> - return subprocess.check_call('%s %s' % (editor, params), shell=True)<br>
> + print(shlex.split(editor) + files)<br>
> + return subprocess.check_call(shlex.split(editor) + files)<br>
> except subprocess.CalledProcessError as exc:<br>
> logger.error("Execution of '%s' failed: %s" % (editor, exc))<br>
> return 1<br>
<br>
I'm guessing you didn't mean to leave the print() above in?<br>
<br>
If the print is there, it breaks:<br>
<br>
"oe-selftest -r devtool.DevtoolTests.test_devtool_add"<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>