Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: grit/tool/build.py

Issue 1271303002: Fix of 466008: [GN] generate files block second-time ninja build (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/tool/build.py
diff --git a/grit/tool/build.py b/grit/tool/build.py
index 8bd1767154cf34be5d653c7bb2323b720bccb790..65a966f5ac041b30a72a202a856c05f0dc025765 100644
--- a/grit/tool/build.py
+++ b/grit/tool/build.py
@@ -7,6 +7,7 @@
SCons build system.
'''
+import codecs
import filecmp
import getopt
import os
@@ -238,9 +239,9 @@ are exported to translation interchange files (e.g. XMB files), etc.
return 0
def __init__(self, defines=None):
- # Default file-creation function is built-in open(). Only done to allow
+ # Default file-creation function is codecs.open(). Only done to allow
# overriding by unit test.
- self.fo_create = open
+ self.fo_create = codecs.open
# key/value pairs of C-preprocessor like defines that are used for
# conditional output of resources
@@ -487,7 +488,7 @@ Extra output files:
depfile_contents = output_file + ': ' + deps_text
self.MakeDirectoriesTo(depfile)
- outfile = self.fo_create(depfile, 'wb')
+ outfile = self.fo_create(depfile, 'w', encoding='utf-8')
outfile.writelines(depfile_contents)
@staticmethod
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698