← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-parse-diff into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-parse-diff into launchpad:master.

Commit message:
Fix parse_diff for Python 3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/394408
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-parse-diff into launchpad:master.
diff --git a/lib/lp/app/browser/stringformatter.py b/lib/lp/app/browser/stringformatter.py
index 151997c..638ebbd 100644
--- a/lib/lp/app/browser/stringformatter.py
+++ b/lib/lp/app/browser/stringformatter.py
@@ -269,7 +269,7 @@ def parse_diff(text):
             yield 'diff-header text', row, None, None, line
         elif line.startswith('@@'):
             try:
-                hunk = hunk_from_header(line + '\n')
+                hunk = hunk_from_header((line + '\n').encode('UTF-8'))
                 # The positions indicate the per-file line numbers of
                 # the next row.
                 orig_row = hunk.orig_pos