Patchwork D2455: py3: use '%d' for integers instead of '%s'

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 12:32 p.m.
Message ID <differential-rev-PHID-DREV-j7jjaowlppnj64hbfsa6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28388/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2018, 12:32 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/patchbomb.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 26, 2018, 1:20 p.m.
yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> patchbomb.py:673
> +        return '<%s.%d@%s>' % (id[:20], int(start_time[0]),
> +                pycompat.sysbytes(socket.getfqdn()))
>  

No idea what encoding is expected, but it could be `encoding.strtolocal()` assuming it was that in Python2.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -669,7 +669,8 @@ 
         start_time = util.makedate()
 
     def genmsgid(id):
-        return '<%s.%s@%s>' % (id[:20], int(start_time[0]), socket.getfqdn())
+        return '<%s.%d@%s>' % (id[:20], int(start_time[0]),
+                pycompat.sysbytes(socket.getfqdn()))
 
     # deprecated config: patchbomb.from
     sender = (opts.get('from') or ui.config('email', 'from') or