Package: reportbug Version: 3.21 Tags: patch Followup-For: Bug #370793
The included patch by Adam Porter had wrong indentation and was missing a colon at the end of an if-expression. Patch attached.
--- reportbug_submit.py.orig 2006-06-07 00:23:33.000000000 +0200 +++ reportbug_submit.py 2006-06-07 00:21:43.000000000 +0200 @@ -350,34 +350,34 @@ toaddrs = [x[1] for x in alist] smtp_message = re.sub(r'(?m)^[.]', '..', message) - # Modified by AP 2006-03-29 - while failed != True: - ewrite("Connecting to %s via SMTP...\n", smtphost) - try: - conn = smtplib.SMTP(smtphost) - if smtptls: - conn.starttls() - if smtpuser: - if not smtppasswd: - smtppasswd = ui.get_password( - 'Enter SMTP password for [EMAIL PROTECTED]: ' % - (smtpuser, smtphost)) - conn.login(smtpuser, smtppasswd) - conn.sendmail(fromaddr, toaddrs, smtp_message) - conn.quit() - except (socket.error, smtplib.SMTPException), x: - - # If wrong password, try again... - if smtplib.SMTPResponseException.smtp_code == '535' - ewrite('SMTP error: authentication failed. Try again.') - continue - - failed = True - ewrite('SMTP send failure: %s\n', x) - fh, msgname = TempFile(prefix=tfprefix) - fh.write(message) - fh.close() - ewrite('Wrote bug report to %s\n', msgname) + # Modified by AP 2006-03-29 + while failed != True: + ewrite("Connecting to %s via SMTP...\n", smtphost) + try: + conn = smtplib.SMTP(smtphost) + if smtptls: + conn.starttls() + if smtpuser: + if not smtppasswd: + smtppasswd = ui.get_password( + 'Enter SMTP password for [EMAIL PROTECTED]: ' % + (smtpuser, smtphost)) + conn.login(smtpuser, smtppasswd) + conn.sendmail(fromaddr, toaddrs, smtp_message) + conn.quit() + except (socket.error, smtplib.SMTPException), x: + + # If wrong password, try again... + if smtplib.SMTPResponseException.smtp_code == '535': + ewrite('SMTP error: authentication failed. Try again.') + continue + + failed = True + ewrite('SMTP send failure: %s\n', x) + fh, msgname = TempFile(prefix=tfprefix) + fh.write(message) + fh.close() + ewrite('Wrote bug report to %s\n', msgname) else: try: pipe.write(message)