[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 <ehmaldonado@chromium.org>
Commit-Queue: Eric Boren <borenet@chromium.org>
changes/60/1637360/2
Eric Boren 6 years ago committed by Commit Bot
parent 9779b146cd
commit 67c4820073

@ -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)

Loading…
Cancel
Save