From 98525bd1d68884930bde7b09ec2d17afecc43963 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 04 2015 14:40:47 +0000 Subject: Enforce the making the patch a unicode string that can then be encoded into UTF-8 This fixes the error seen at: http://dev.pagure.org/mailman3/acc302099df53474e631117351f8116727c1ceb6.patch --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index e50edc8..ebae4a9 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -57,7 +57,7 @@ def commit_to_patch(repo_obj, commits): if len(commits) > 1: subject = '[PATCH %s/%s] %s' % (cnt + 1, len(commits), subject) - patch += """From {commit} Mon Sep 17 00:00:00 2001 + patch += u"""From {commit} Mon Sep 17 00:00:00 2001 From: {author_name} <{author_email}> Date: {date} Subject: {subject} @@ -73,7 +73,7 @@ Subject: {subject} commit.commit_time).strftime('%b %d %Y %H:%M:%S +0000'), subject=subject, msg=message, - patch=diff.patch.encode('utf-8')) + patch=diff.patch) return patch