From 67c48200732195aa9a9a1d13b895d43ac68692d8 Mon Sep 17 00:00:00 2001 From: Eric Boren Date: Thu, 30 May 2019 16:52:51 +0000 Subject: [PATCH] [git-cl] Fix crash in "git cl upload" This occurs when the command is run on autorollers. Change-Id: I264b85e906617412538b333b06414479b4acc386 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1637360 Reviewed-by: Edward Lesmes Commit-Queue: Eric Boren --- git_cl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 3b1a8dd789..0df89c4d50 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2552,7 +2552,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): git_info_zip = trace_name + '-git-info' git_push_metadata['now'] = datetime_now().strftime('%c') - if sys.stdin.encoding != 'utf-8': + if sys.stdin.encoding and sys.stdin.encoding != 'utf-8': git_push_metadata['now'] = git_push_metadata['now'].decode( sys.stdin.encoding)