Patchwork D3707: py3: use `b'%d' % int` instead of pycompat.bytestr

login
register
mail settings
Submitter phabricator
Date June 10, 2018, 10:32 a.m.
Message ID <differential-rev-PHID-DREV-rnylm7q4lxax4pnmof3w-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32045/
State Superseded
Headers show

Comments

phabricator - June 10, 2018, 10:32 a.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/D3707

AFFECTED FILES
  mercurial/posix.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
Yuya Nishihara - June 10, 2018, 2:51 p.m.
>      except KeyError:
> -        return pycompat.bytestr(uid)
> +        return b'%d' % uid

Folded this with D3706, thanks.
phabricator - June 10, 2018, 3:01 p.m.
yuja added a comment.


  >   except KeyError:
  > 
  > - return pycompat.bytestr(uid) +        return b'%d' % uid
  
  Folded this with https://phab.mercurial-scm.org/D3706, thanks.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -543,7 +543,7 @@ 
     try:
         return pycompat.fsencode(pwd.getpwuid(uid)[0])
     except KeyError:
-        return pycompat.bytestr(uid)
+        return b'%d' % uid
 
 def groupname(gid=None):
     """Return the name of the group with the given gid.