Commit 5e18b605 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Fix git cl upload on Windows

Use ISO8601 time format standard to avoid localized result and need to
encode.

R=ehmaldonado@chromium.org

Bug: 1074002
Change-Id: I95c2ddd55a9661351f2b45601f7bba24c2951c31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2163401Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 11b34154
......@@ -2029,10 +2029,7 @@ class Changelist(object):
git_info_dir = tempfile.mkdtemp()
git_info_zip = trace_name + '-git-info'
git_push_metadata['now'] = datetime_now().strftime('%c')
if sys.stdin.encoding and sys.stdin.encoding != 'utf-8':
git_push_metadata['now'] = git_push_metadata['now'].decode(
sys.stdin.encoding)
git_push_metadata['now'] = datetime_now().strftime('%Y-%m-%dT%H:%M:%S.%f')
git_push_metadata['trace_name'] = trace_name
gclient_utils.FileWrite(
......
......@@ -858,9 +858,6 @@ class TestGitCl(unittest.TestCase):
final_description = final_description or post_amend_description.strip()
date_format = ('03/16/17 20:00:41'
if sys.platform == 'win32' and sys.version_info.major == 2
else 'Thu Mar 16 20:00:41 2017')
trace_name = os.path.join('TRACES_DIR', '20170316T200041.000000')
# Trace-related calls
......@@ -877,7 +874,7 @@ class TestGitCl(unittest.TestCase):
'1000\n'
'0\n'
'%(trace_name)s' % {
'date': date_format,
'date': '2017-03-16T20:00:41.000000',
'short_hostname': short_hostname,
'change_id': change_id,
'description': final_description,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment