From b61e6813ab0273791f7cdf518eee214db7cc0f9b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 12 2016 11:52:34 +0000 Subject: Write down the content in UTF-8 to avoid unicode error Fixes https://pagure.io/pagure/issue/868 --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 9bbf444..e4ea3b2 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -732,7 +732,7 @@ def update_file_in_git( # Write down what changed with open(file_path, 'w') as stream: - stream.write(content.replace('\r', '')) + stream.write(content.replace('\r', '').encode('utf-8')) # Retrieve the list of files that changed diff = new_repo.diff()