diff --git a/gunicorn/pidfile.py b/gunicorn/pidfile.py index 4cf603c7..45b32de1 100644 --- a/gunicorn/pidfile.py +++ b/gunicorn/pidfile.py @@ -66,7 +66,10 @@ class Pidfile(object): return try: with open(self.fname, "r") as f: - wpid = int(f.read() or 0) + try: + wpid = int(f.read()) + except ValueError: + wpid = 0 if wpid <= 0: return