<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 24 November 2014 at 09:40, Sandro Tosi <span dir="ltr"><<a href="mailto:morph@debian.org" target="_blank">morph@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">at first look it seems exactly the temp file is not there, hence the crash.<br></blockquote><div><br></div><div>Which is kind of weird, the temp file should be there.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">In my setup I have smtphost set, and it works, so it smells like<br>
something else got in the middle.<br></blockquote><div><br></div><div>IIRC, I ran this from an unstable schroot, I don't have smtphost set (yes, probably should change that), and sendmail wasn't installed.</div><div><br></div><div>So I don't expect this to work.</div><div><br></div><div><div>This is reproducible.</div></div><div><br></div><div>However, it does seem odd that the temporary file is getting deleted. Hmmm. If I understand the code correctly now, it deletes the file created by the editor, and creates a new file if required. I thought it would keep the edited file around.</div><div><br></div><div>There does seem to be a logic error on these lines:</div><div><br></div><div>if outfile or not ((mta and os.path.exists(mta)) or smtphost):</div><div>    msgname = os.path.expanduser(outfile) or ('/var/tmp/%s.bug' % package)</div><div><br></div><div>I think the intention of this line is "if the user requested that we write file to outfile or no valid MTA is defined then we should write to a file".</div><div><br></div><div>However, this is a problem if we get into this code because if no valid MTA is defined and the outfile command line option was never set. We have a default, however that default doesn't happen in time, we have already crashed before we get to it.</div><div><br></div><div>So if we change that code to something like the following, it should stop it crashing:</div><div><br></div><div><div>    elif outfile or not ((mta and os.path.exists(mta)) or smtphost):</div><div>        if outfile:</div><div>            msgname = os.path.expanduser(outfile) </div><div>        else:</div><div>            msgname = '/var/tmp/%s.bug' % package</div></div><div><br></div><div>That certainly looks better now:</div><div><br></div><div><div>--- cut ---</div><div>Please select tags: (one at a time) [none] </div><div>Gathering additional data, this may take a while...</div><div>Spawning vimnobak...</div><div>Report will be sent to Brian May <<a href="mailto:bam@debian.org">bam@debian.org</a>></div><div>Submit this report on reportbug (e to edit) [Y|n|a|c|e|i|l|m|p|q|d|t|s|?]? y</div><div>Bug report written as /var/tmp/reportbug.bug</div></div><div>--- cut ---</div><div><br></div><div>It could also say why it didn't try to send the report too, but at least now it isn't crashing, and it is writing the report to a file.</div></div>-- <br><div class="gmail_signature">Brian May <<a href="mailto:brian@microcomaustralia.com.au" target="_blank">brian@microcomaustralia.com.au</a>></div>
</div></div>