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

Unified Diff: recipes.py

Issue 2798393002: Work around unicode issues by re-encoding properties as utf-8 (Closed)
Patch Set: fixes Created 3 years, 8 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 | « recipe_modules/json/api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index 0626c1f356f2ef24611b9eab21b59192bc8d006c..5b590c7edf55f34b515b0ac0dc21a26d93e0be14 100755
--- a/recipes.py
+++ b/recipes.py
@@ -18,11 +18,15 @@ import subprocess
import sys
import tempfile
+reload(sys)
iannucci 2017/04/06 18:15:59 Comment: # This is necessary to ensure that str l
Paweł Hajdan Jr. 2017/04/06 18:18:41 Done.
+sys.setdefaultencoding('UTF8')
+
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, ROOT_DIR)
from recipe_engine import env
from recipe_engine import arguments_pb2
+from recipe_engine import util as recipe_util
from google.protobuf import json_format as jsonpb
@@ -232,6 +236,8 @@ def run(package_deps, args, op_args):
properties['recipe'] = args.recipe
+ properties = recipe_util.strip_unicode(properties)
+
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['PYTHONIOENCODING'] = 'UTF-8'
« no previous file with comments | « recipe_modules/json/api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698