diff options
author | martin f. krafft <madduck@madduck.net> | 2010-02-05 04:33:25 +0100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2010-12-13 08:22:21 +0800 |
commit | 7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e (patch) | |
tree | 8d898d9dc4b9f926e59a4b1de6ae44d70e2b76ea /apps | |
parent | ad4715cef72910b1310d4b93a2294ace878b0b4a (diff) | |
download | patchwork-7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e.tar.bz2 patchwork-7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e.tar.xz |
Decode patch from UTF-8 while parsing from stdin
Patchwork (rightfully) hashes patches using UTF-8:
parser.py:
def hash_patch(str):
[…]
hash.update(line.encode('utf-8') + '\n')
This patch makes sure that it treats the incoming data as UTF-8 as well.
Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/patchwork/parser.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/patchwork/parser.py b/apps/patchwork/parser.py index 2b5e9a0..24631b7 100644 --- a/apps/patchwork/parser.py +++ b/apps/patchwork/parser.py @@ -63,8 +63,7 @@ def parse_patch(text): lc = (0, 0) hunk = 0 - - for line in text.split('\n'): + for line in text.decode('utf-8').split('\n'): line += '\n' if state == 0: |