# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-11-29 03:14:06 # Node ID b45a9d121b53cde9c41da183ee57e416d675bc1b # Parent 08b8b56bd2e8a03beea1b024bbb48d30c3346ffc py3: make sure the first argument of time.strftime() is str time.strftime() does not accepts bytes as its first argument on py3. Differential Revision: https://phab.mercurial-scm.org/D1559 diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py --- a/hgext/bugzilla.py +++ b/hgext/bugzilla.py @@ -580,7 +580,7 @@ class bzmysql(bzaccess): self.ui.warn(_("Bugzilla/MySQL cannot update bug state\n")) (user, userid) = self.get_bugzilla_user(committer) - now = time.strftime('%Y-%m-%d %H:%M:%S') + now = time.strftime(r'%Y-%m-%d %H:%M:%S') self.run('''insert into longdescs (bug_id, who, bug_when, thetext) values (%s, %s, %s, %s)''', diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -719,7 +719,7 @@ def debugstate(ui, repo, **opts): elif nodates: timestr = 'set ' else: - timestr = time.strftime("%Y-%m-%d %H:%M:%S ", + timestr = time.strftime(r"%Y-%m-%d %H:%M:%S ", time.localtime(ent[3])) if ent[1] & 0o20000: mode = 'lnk' diff --git a/mercurial/mail.py b/mercurial/mail.py --- a/mercurial/mail.py +++ b/mercurial/mail.py @@ -152,7 +152,7 @@ def _mbox(mbox, sender, recipients, msg) fp = open(mbox, 'ab+') # Should be time.asctime(), but Windows prints 2-characters day # of month instead of one. Make them print the same thing. - date = time.strftime('%a %b %d %H:%M:%S %Y', time.localtime()) + date = time.strftime(r'%a %b %d %H:%M:%S %Y', time.localtime()) fp.write('From %s %s\n' % (sender, date)) fp.write(msg) fp.write('\n\n')