changeset 37672:8bacc09814ba

py3: make values bytes before passing into server.runservice() The values of opts dict still needed to be converted to bytes. Differential Revision: https://phab.mercurial-scm.org/D3330
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 14 Apr 2018 02:07:42 +0530
parents 726a95a57eeb
children 0c6b1ec75b73
files tests/dumbhttp.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/dumbhttp.py	Fri Apr 13 18:44:18 2018 -0400
+++ b/tests/dumbhttp.py	Sat Apr 14 02:07:42 2018 +0530
@@ -13,6 +13,7 @@
 import sys
 
 from mercurial import (
+    pycompat,
     server,
     util,
 )
@@ -63,10 +64,12 @@
     if options.foreground and options.pid:
         parser.error("options --pid and --foreground are mutually exclusive")
 
-    opts = {'pid_file': options.pid,
-            'daemon': not options.foreground,
-            'daemon_postexec': options.daemon_postexec}
+    opts = {b'pid_file': options.pid,
+            b'daemon': not options.foreground,
+            b'daemon_postexec': options.daemon_postexec}
     service = simplehttpservice(options.host, options.port)
+    runargs = [sys.executable, __file__] + sys.argv[1:]
+    runargs = [pycompat.fsencode(a) for a in runargs]
     server.runservice(opts, initfn=service.init, runfn=service.run,
                       logfile=options.logfile,
-                      runargs=[sys.executable, __file__] + sys.argv[1:])
+                      runargs=runargs)