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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: c21297f6210a78bd137dd1be805d63eb96924ba2
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-parse-diff
Merge into: launchpad:master
Diff against target: 13 lines (+1/-1)
1 file modified
lib/lp/app/browser/stringformatter.py (+1/-1)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+394408@code.launchpad.net

Commit message

Fix parse_diff for Python 3

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/app/browser/stringformatter.py b/lib/lp/app/browser/stringformatter.py
2index 151997c..638ebbd 100644
3--- a/lib/lp/app/browser/stringformatter.py
4+++ b/lib/lp/app/browser/stringformatter.py
5@@ -269,7 +269,7 @@ def parse_diff(text):
6 yield 'diff-header text', row, None, None, line
7 elif line.startswith('@@'):
8 try:
9- hunk = hunk_from_header(line + '\n')
10+ hunk = hunk_from_header((line + '\n').encode('UTF-8'))
11 # The positions indicate the per-file line numbers of
12 # the next row.
13 orig_row = hunk.orig_pos

Subscribers

People subscribed via source and target branches

to status/vote changes: