diff --git a/functional-tests/040-test_simple_rebase.sh b/functional-tests/040-test_simple_rebase.sh index 7010389..4622ed7 100755 --- a/functional-tests/040-test_simple_rebase.sh +++ b/functional-tests/040-test_simple_rebase.sh @@ -40,7 +40,8 @@ index 170ec46..251e1dd 100644 keywords="git hpcloud workflow", EOP - git commit -a -m "Add maintainer info" --quiet || return 1 + # use smart quotes to test unicode characters in commit messages + git commit -a -m "Add “Davide Guerri” as maintainer" --quiet || return 1 git push -u origin master --quiet >/dev/null || return 1 log DEBUG "Cherry picking upstream commits" diff --git a/git_upstream/lib/rebaseeditor.py b/git_upstream/lib/rebaseeditor.py index a7e04fe..bd81cb2 100644 --- a/git_upstream/lib/rebaseeditor.py +++ b/git_upstream/lib/rebaseeditor.py @@ -20,6 +20,7 @@ from git_upstream.log import LogDedentMixin from subprocess import call import os +import codecs REBASE_EDITOR_SCRIPT = "rebase-editor" @@ -78,7 +79,7 @@ class RebaseEditor(GitMixin, LogDedentMixin): break root = None - with open(todo_file, "w") as todo: + with codecs.open(todo_file, "w", "utf-8") as todo: for commit in commits: if not root: root = commit.parents[0].hexsha