[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>
diff --git a/git_cl.py b/git_cl.py
index 3b1a8dd..0df89c4 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2552,7 +2552,7 @@
     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)