[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.0-35-g98280a7

Sandro Tosi morph at debian.org
Fri Apr 10 21:09:51 UTC 2009


The following commit has been merged in the master branch:
commit 98280a7e974827e5c3a81b5baff9d483a804e544
Author: Sandro Tosi <morph at debian.org>
Date:   Fri Apr 10 23:09:03 2009 +0200

    * reportbug/submit.py
      - better handling of file with UTF8 name, using subprocess.Popen; thanks to
        Sam Morris for the report and Carl Chenet for the patch; Closes: #491869

diff --git a/debian/changelog b/debian/changelog
index 94e55ef..e11b0ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,7 +21,10 @@ reportbug (4.1) UNRELEASED; urgency=low
       Closes: #445443
   * reportbug/utils.py
     - correctly recognize the CPUs number on Alpha systems; thanks to Juhana
-      Helovuo for the report and and Carl Chenet for the patch; Closes: #512675
+      Helovuo for the report and Carl Chenet for the patch; Closes: #512675
+  * reportbug/submit.py
+    - better handling of file with UTF8 name, using subprocess.Popen; thanks to
+      Sam Morris for the report and Carl Chenet for the patch; Closes: #491869
 
   [ Luca Bruno ]
   * bin/reportbug
@@ -54,7 +57,7 @@ reportbug (4.1) UNRELEASED; urgency=low
     - do not try to import newt ui as default ui, since it's removed now; use
       text ui instead
 
- -- Sandro Tosi <morph at debian.org>  Fri, 10 Apr 2009 22:37:13 +0200
+ -- Sandro Tosi <morph at debian.org>  Fri, 10 Apr 2009 23:06:59 +0200
 
 reportbug (4.0) unstable; urgency=low
 
diff --git a/reportbug/submit.py b/reportbug/submit.py
index 70ce584..ca25063 100644
--- a/reportbug/submit.py
+++ b/reportbug/submit.py
@@ -27,6 +27,7 @@ import sys
 import os
 import re
 import commands
+from subprocess import Popen, STDOUT, PIPE
 import rfc822
 import smtplib
 import socket
@@ -165,9 +166,8 @@ def mime_attach(body, attachments, charset, body_charset=None):
             continue
         ctype = None
         cset = charset
-        info = commands.getoutput('file --mime --brief' +
-                                   commands.mkarg(attachment) +
-                                  ' 2>/dev/null')
+        info = Popen(['file','--mime', '--brief', attachment],
+            stdout=PIPE, stderr=STDOUT).communicate()[0]
         if info:
             match = re.match(r'([^;, ]*)(,[^;]+)?(?:; )?(.*)', info)
             if match:

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list