← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~james-w/python-oops-tools/decode-reports into lp:python-oops-tools

 

James Westby has proposed merging lp:~james-w/python-oops-tools/decode-reports into lp:python-oops-tools.

Commit message:
Decode the report when reading it to send the email.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~james-w/python-oops-tools/decode-reports/+merge/138267

Hi,

These are a couple of changes that are currently cowboyed on the oops.canonical.com
server, so we should land them. I think they make sense, and have been running
fine in production for a while.

Thanks,

James
-- 
https://code.launchpad.net/~james-w/python-oops-tools/decode-reports/+merge/138267
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~james-w/python-oops-tools/decode-reports into lp:python-oops-tools.
=== modified file 'src/oopstools/scripts/prune.py'
--- src/oopstools/scripts/prune.py	2012-09-26 07:27:56 +0000
+++ src/oopstools/scripts/prune.py	2012-12-05 17:34:32 +0000
@@ -87,7 +87,7 @@
                     'One of options %s must be supplied' % (optnames,))
     needed('project', 'projectgroup')
     logging.basicConfig(
-        filename='prune.log', filemode='w', level=logging.DEBUG)
+        filename='logs/prune.log', filemode='w', level=logging.DEBUG)
     one_week = datetime.timedelta(weeks=1)
     one_day = datetime.timedelta(days=1)
     # Only prune OOPS reports more than one week old.

=== modified file 'src/oopstools/scripts/report.py'
--- src/oopstools/scripts/report.py	2012-08-07 03:57:32 +0000
+++ src/oopstools/scripts/report.py	2012-12-05 17:34:32 +0000
@@ -84,7 +84,7 @@
             body_text = (
                 'Full summary available at:\n'
                 '   %s/%s.html\n\n' % (settings.SUMMARY_URI, report_filename))
-            body_text += open(txt_file).read()
+            body_text += open(txt_file).read().decode('utf-8', 'replace')
         else:
             body_text = "No %s OOPSes found for %s" % (
                 report.title, yesterday_string)