mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
use byte string when writing to pid file - fix #504
This commit is contained in:
parent
a314f5adb1
commit
770005f73d
@ -36,7 +36,7 @@ class Pidfile(object):
|
|||||||
if fdir and not os.path.isdir(fdir):
|
if fdir and not os.path.isdir(fdir):
|
||||||
raise RuntimeError("%s doesn't exist. Can't create pidfile." % fdir)
|
raise RuntimeError("%s doesn't exist. Can't create pidfile." % fdir)
|
||||||
fd, fname = tempfile.mkstemp(dir=fdir)
|
fd, fname = tempfile.mkstemp(dir=fdir)
|
||||||
os.write(fd, "%s\n" % self.pid)
|
os.write(fd, ("%s\n" % self.pid).encode('utf-8'))
|
||||||
if self.fname:
|
if self.fname:
|
||||||
os.rename(fname, self.fname)
|
os.rename(fname, self.fname)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user