changeset 32330:2959c3e986e0

py3: convert date and format arguments str before passing in time.strptime time.strptime() raises ValueError if the arguments are not str. Source Code: https://hg.python.org/cpython/file/3.5/Lib/_strptime.py#l307
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 06 May 2017 04:51:25 +0530
parents 770bbfdc9644
children bd872f64a8ba
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Thu May 04 00:24:21 2017 +0530
+++ b/mercurial/util.py	Sat May 06 04:51:25 2017 +0530
@@ -1937,7 +1937,8 @@
             # elements are relative to today
             usenow = True
 
-    timetuple = time.strptime(date, format)
+    timetuple = time.strptime(encoding.strfromlocal(date),
+                              encoding.strfromlocal(format))
     localunixtime = int(calendar.timegm(timetuple))
     if offset is None:
         # local timezone