From 46b9fee9908786b7c048d64f0b080649174e676b Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Thu, 19 Jul 2012 15:41:31 +0000 Subject: [PATCH] gclient_utils.FileWrite() assumes text data but trychange doesn't. Use manual file writing, it's just two lines. TBR=nsylvain@chromium.org BUG= TEST=git try works with non-ascii patches Review URL: https://chromiumcodereview.appspot.com/10815009 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@147447 0039d316-1c4b-4281-b951-d872f2087c98 --- trychange.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trychange.py b/trychange.py index 4a29aecd6b..ceeeecea9b 100755 --- a/trychange.py +++ b/trychange.py @@ -399,7 +399,8 @@ def _SendChangeSVN(options): file_name = (Escape(options.user) + '.' + Escape(options.name) + '.%s.diff' % current_time) full_path = os.path.join(temp_dir, file_name) - gclient_utils.FileWrite(full_path, options.diff, 'wb') + with open(full_path, 'wb') as f: + f.write(options.diff) # Committing it will trigger a try job. if sys.platform == "cygwin":