[Reportbug-commits] [reportbug] 04/11: correctly handle the case where there is not MTA or smtphost defined; Closes: #782319, #780825, #769055

Sandro Tosi morph at moszumanska.debian.org
Wed Apr 15 18:08:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository reportbug.

commit 3b9cb82c8972b5190fd1364256ce18742b3fd16c
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Apr 12 23:14:21 2015 +0100

    correctly handle the case where there is not MTA or smtphost defined; Closes: #782319, #780825, #769055
---
 debian/changelog    |  5 ++++-
 reportbug/submit.py | 10 +++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4d439e6..753625f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,8 +7,11 @@ reportbug (6.6.4) UNRELEASED; urgency=medium
     - report PAGER environment variable when filing a bug against reportbug
   * reportbug/ui/gtk2_ui.py
     - correctly acquire GDK mutual exclusion lock
+  * reportbug/submit.py
+    - correctly handle the case where there is not MTA or smtphost defined;
+      Closes: #782319, #780825, #769055
 
- -- Sandro Tosi <morph at debian.org>  Sun, 12 Apr 2015 20:41:14 +0100
+ -- Sandro Tosi <morph at debian.org>  Sun, 12 Apr 2015 23:14:00 +0100
 
 reportbug (6.6.3) unstable; urgency=medium
 
diff --git a/reportbug/submit.py b/reportbug/submit.py
index 9a728a4..b3469f4 100644
--- a/reportbug/submit.py
+++ b/reportbug/submit.py
@@ -312,8 +312,12 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
         pipe = sys.stdout
     elif mua:
         pipe, filename = TempFile(prefix=tfprefix, dir=draftpath)
-    elif outfile or not ((mta and os.path.exists(mta)) or smtphost):
-        msgname = os.path.expanduser(outfile) or ('/var/tmp/%s.bug' % package)
+    elif outfile or not ((mta and os.path.exists(mta)) and not smtphost):
+        # outfile can be None at this point
+        if outfile:
+            msgname = os.path.expanduser(outfile)
+        else:
+            msgname = '/var/tmp/%s.bug' % package
         if os.path.exists(msgname):
             try:
                 os.rename(msgname, msgname+'~')
@@ -331,7 +335,7 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
             # we just need a place where to write() and a file handler
             # is here just for that
             pipe = fh
-    elif mta and not smtphost:
+    elif (mta and os.path.exists(mta)) and not smtphost:
         try:
             x = os.getcwd()
         except OSError:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git



More information about the Reportbug-commits mailing list