changeset 31449:756175623f2e

py3: call strftime() with native str type Since strftime() may contain non-ascii character if locale set, we use strfrom/tolocal(). Now "hg tip" works.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 13 Mar 2017 09:19:07 -0700
parents 6419cd243017
children b3b4c487707c
files mercurial/util.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Mon Mar 13 09:12:56 2017 -0700
+++ b/mercurial/util.py	Mon Mar 13 09:19:07 2017 -0700
@@ -1792,7 +1792,7 @@
     # because they use the gmtime() system call which is buggy on Windows
     # for negative values.
     t = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=d)
-    s = t.strftime(format)
+    s = encoding.strtolocal(t.strftime(encoding.strfromlocal(format)))
     return s
 
 def shortdate(date=None):