Patchwork D8675: ui: fix Python 2.7 support for ui.timestamp-output

login
register
mail settings
Submitter phabricator
Date July 2, 2020, 5:55 p.m.
Message ID <differential-rev-PHID-DREV-g6tjdwm4yqp2i3remg7r-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46612/
State Superseded
Headers show

Comments

phabricator - July 2, 2020, 5:55 p.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1229,7 +1229,7 @@ 
         }
         if timestamp:
             args = (
-                b'[%s] ' % bytes(datetime.datetime.now().isoformat(), 'ASCII'),
+                b'[%s] ' % pycompat.sysstr(datetime.datetime.now().isoformat()),
             ) + args
         _writemsgwith(self._write, dest, *args, **opts)
         if timestamp: