# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-05-05 23:21:25 # Node ID 2959c3e986e0840b383202c8e0785805f68d086f # Parent 770bbfdc9644b7261bf2c2c28300f19c2c61176e 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 diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1937,7 +1937,8 @@ def strdate(string, format, defaults=Non # 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