[PATCH 3 of 3] py3: simply use b'%d\n' to format pid in server.py

Augie Fackler raf at durin42.com
Thu Jun 1 10:55:18 EDT 2017


On Thu, Jun 01, 2017 at 11:35:47PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1496325929 -32400
> #      Thu Jun 01 23:05:29 2017 +0900
> # Node ID ee0119499321b4b1df8e04694d82f6ca425e60df
> # Parent  4bdbaa7eb382e3bff59f05342ac6a5a5fcac42ed
> py3: simply use b'%d\n' to format pid in server.py

Queued these, many thanks.

>
> Spotted by Martin, thanks.
>
> diff --git a/mercurial/server.py b/mercurial/server.py
> --- a/mercurial/server.py
> +++ b/mercurial/server.py
> @@ -33,7 +33,7 @@ def runservice(opts, parentfn=None, init
>              else:
>                  mode = 'wb'
>              fp = open(opts['pid_file'], mode)
> -            fp.write(str(pid).encode('latin1') + '\n')
> +            fp.write('%d\n' % pid)
>              fp.close()
>
>      if opts['daemon'] and not opts['daemon_postexec']:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list