##// END OF EJS Templates
server: stop using the `pycompat.open()` shim
Matt Harbison -
r53275:e1f0125b default
parent child Browse files
Show More
@@ -10,7 +10,6 from __future__ import annotations
10 import os
10 import os
11
11
12 from .i18n import _
12 from .i18n import _
13 from .pycompat import open
14
13
15 from . import (
14 from . import (
16 chgserver,
15 chgserver,
@@ -76,9 +75,9 def runservice(
76 def writepid(pid):
75 def writepid(pid):
77 if opts[b'pid_file']:
76 if opts[b'pid_file']:
78 if appendpid:
77 if appendpid:
79 mode = b'ab'
78 mode = 'ab'
80 else:
79 else:
81 mode = b'wb'
80 mode = 'wb'
82 fp = open(opts[b'pid_file'], mode)
81 fp = open(opts[b'pid_file'], mode)
83 fp.write(b'%d\n' % pid)
82 fp.write(b'%d\n' % pid)
84 fp.close()
83 fp.close()
@@ -109,7 +108,7 def runservice(
109 # If the daemonized process managed to write out an error msg,
108 # If the daemonized process managed to write out an error msg,
110 # report it.
109 # report it.
111 if pycompat.iswindows and os.path.exists(lockpath):
110 if pycompat.iswindows and os.path.exists(lockpath):
112 with open(lockpath, b'rb') as log:
111 with open(lockpath, 'rb') as log:
113 for line in log:
112 for line in log:
114 procutil.stderr.write(line)
113 procutil.stderr.write(line)
115 raise error.Abort(_(b'child process failed to start'))
114 raise error.Abort(_(b'child process failed to start'))
General Comments 0
You need to be logged in to leave comments. Login now