From ec85b32d3b9a3f57ed06d932930d437abb87e62c Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Sat, 9 Dec 2023 04:06:40 +0100 Subject: [PATCH] Pythn 2.7+: open arg defaults to r --- gunicorn/pidfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gunicorn/pidfile.py b/gunicorn/pidfile.py index 06abb34e..c1dd1cb9 100644 --- a/gunicorn/pidfile.py +++ b/gunicorn/pidfile.py @@ -51,7 +51,7 @@ class Pidfile: def unlink(self): """ delete pidfile""" try: - with open(self.fname, "r") as f: + with open(self.fname) as f: pid1 = int(f.read() or 0) if pid1 == self.pid: @@ -64,7 +64,7 @@ class Pidfile: if not self.fname: return try: - with open(self.fname, "r") as f: + with open(self.fname) as f: try: wpid = int(f.read()) except ValueError: