Patchwork D1559: py3: make sure the first argument of time.strftime() is str

login
register
mail settings
Submitter phabricator
Date Nov. 30, 2017, 12:59 p.m.
Message ID <bccc059aafc1af231cc06506bd5d539c@localhost.localdomain>
Download mbox | patch
Permalink /patch/25829/
State Not Applicable
Headers show

Comments

phabricator - Nov. 30, 2017, 12:59 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb45a9d121b53: py3: make sure the first argument of time.strftime() is str (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1559?vs=3983&id=4008

REVISION DETAIL
  https://phab.mercurial-scm.org/D1559

AFFECTED FILES
  hgext/bugzilla.py
  mercurial/debugcommands.py
  mercurial/mail.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -152,7 +152,7 @@ 
     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')
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -719,7 +719,7 @@ 
         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/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -580,7 +580,7 @@ 
             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)''',