From d04bb173512e85b9081b414778e5d611ce38b2f7 Mon Sep 17 00:00:00 2001 From: zzjin Date: Fri, 13 Feb 2015 20:46:34 +0800 Subject: [PATCH] Update commit.py sync st2 commit.py to support non-ascii codecs --- commit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commit.py b/commit.py index 19bea66c..2526783b 100644 --- a/commit.py +++ b/commit.py @@ -6,6 +6,7 @@ import sublime_plugin from .git import GitTextCommand, GitWindowCommand, plugin_file, view_contents, _make_text_safeish from .add import GitAddSelectedHunkCommand +import codecs history = [] @@ -121,7 +122,7 @@ def message_done(self, message): message_file.close() self.message_file = message_file # and actually commit - with open(message_file.name, 'r') as fp: + with codecs.open(message_file.name, mode = 'r', encoding = 'utf-8') as fp: self.run_command(['git', 'commit', '-F', '-', self.extra_options], self.commit_done, working_dir=self.working_dir, stdin=fp.read())