[Reportbug-commits] r585 - in branches/modules (bin/reportbug debian/changelog)

lawrencc at users.alioth.debian.org lawrencc at users.alioth.debian.org
Thu Jul 24 18:54:23 UTC 2008


    Date: Thursday, July 24, 2008 @ 18:54:22
  Author: lawrencc
Revision: 585

Merge commit 'trunk' into modules

Modified:
  branches/modules/bin/reportbug
  branches/modules/debian/changelog

Modified: branches/modules/bin/reportbug
===================================================================
--- branches/modules/bin/reportbug	2008-07-24 18:54:12 UTC (rev 584)
+++ branches/modules/bin/reportbug	2008-07-24 18:54:22 UTC (rev 585)
@@ -95,7 +95,7 @@
 
 def include_file_in_report(message, message_filename,
                            attachment_filenames, package_name,
-                           include_filename, inline=False):
+                           include_filename, charset, inline=False):
     """ Include a file in the report.
 
         :parameters:
@@ -122,10 +122,13 @@
     if inline:
         try:
             fp = open(include_filename)
-            message += '\n*** %s\n%s' % (include_filename, fp.read())
+            message += '\n*** %s\n%s' % (
+                       include_filename.decode(charset, 'replace'),
+                       fp.read().decode(charset, 'replace'))
             fp.close()
-            fp, temp_filename = TempFile(prefix=tempfile_prefix(package_name))
-            fp.write(message)
+            fp, temp_filename = TempFile(
+                prefix=tempfile_prefix(package_name))
+            fp.write(message.encode(charset, 'replace'))
             fp.close()
             os.unlink(message_filename)
             message_filename = temp_filename
@@ -222,7 +225,7 @@
                         inline = (x == 'i')
                         (message, filename, attachments) = include_file_in_report(
                             message, filename, attachments, package,
-                            attachfile, inline=inline)
+                            attachfile, charset, inline=inline)
                         if not inline:
                             skip_editing = True
                     else:
@@ -1059,7 +1062,9 @@
             for f in self.options.include:
                 if os.path.exists(f):
                     fp = open(f)
-                    incfiles = u'%s\n*** %s\n%s' % (incfiles, f, fp.read().decode('utf-8', 'replace'))
+                    incfiles = u'%s\n*** %s\n%s' % (
+                               incfiles, f.decode('utf-8', 'replace'),
+                               fp.read().decode('utf-8', 'replace'))
                     fp.close()
                 else:
                     ewrite("Can't find %s to include!\n", f)

Modified: branches/modules/debian/changelog
===================================================================
--- branches/modules/debian/changelog	2008-07-24 18:54:12 UTC (rev 584)
+++ branches/modules/debian/changelog	2008-07-24 18:54:22 UTC (rev 585)
@@ -1,3 +1,11 @@
+reportbug (3.44) UNRELEASED; urgency=low
+
+  [ Chris Lawrence ]
+  * reportbug
+    + Yet another character set issue fix.  (Closes: #492240)
+
+ -- Chris Lawrence <lawrencc at debian.org>  Thu, 24 Jul 2008 13:48:55 -0500
+
 reportbug (3.43) unstable; urgency=medium
 
   [ Ben Finney ]




More information about the Reportbug-commits mailing list