From 770005f73de88193b922a9da7c53218a0d93f43c Mon Sep 17 00:00:00 2001 From: Kevin Luikens Date: Mon, 11 Mar 2013 16:16:42 -0700 Subject: [PATCH] use byte string when writing to pid file - fix #504 --- gunicorn/pidfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/pidfile.py b/gunicorn/pidfile.py index c8fa4c4e..32a9ac37 100644 --- a/gunicorn/pidfile.py +++ b/gunicorn/pidfile.py @@ -36,7 +36,7 @@ class Pidfile(object): if fdir and not os.path.isdir(fdir): raise RuntimeError("%s doesn't exist. Can't create pidfile." % 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: os.rename(fname, self.fname) else: