<div dir="ltr">We used to not do any formatting when stderr was non-empty. Now with Alex's error reporting, this changes, but we still want to capture stderr and print a single-line error, so that the vim does not shuffle around or flash..</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 10, 2013 at 8:20 PM, Kim Gräsman <span dir="ltr"><<a href="mailto:kim.grasman@gmail.com" target="_blank">kim.grasman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jan 10, 2013 at 1:04 AM, Matt Beaumont-Gay <<a href="mailto:matthewbg@google.com">matthewbg@google.com</a>> wrote:<br>

>> +<br>
>> +  offset, length = getOffsetLength(filename, line_number, line_count)<br>
>> +  with open(filename, 'r') as f:<br>
>> +    text = f.read()<br>
>> +  p = subprocess.Popen([binary, '-offset', str(offset), '-length', str(length),<br>
>> +                        '-style', style],<br>
>> +                       stdout=subprocess.PIPE, stderr=subprocess.PIPE,<br>
>> +                       stdin=subprocess.PIPE)<br>
>> +  stdout, stderr = p.communicate(input=text)<br>
>> +  if stderr:<br>
>> +    print stderr<br>
><br>
> print >>sys.stderr, stderr<br>
><br>
> Or just hook up the subprocess's stderr to our stderr?<br>
<br>
</div>There's the risk of deadlock that speaks against that:<br>
<a href="http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait" target="_blank">http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait</a><br>
<br>
This might be a Windows-only problem, but it's no fun to debug, trust me :-)<br>
<span class="HOEnZb"><font color="#888888"><br>
- Kim<br>
</font></span></blockquote></div><br></div>