[PATCH 07 of 11 logilab-common] [py3] file() doesn't exist in python3

Laurent Peuch cortex at worlddomination.be
Wed Apr 1 16:20:08 CEST 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1584571365 -3600
#      Wed Mar 18 23:42:45 2020 +0100
# Node ID b1b8320eb626ef5cb36bf3e72cd619722db7bfe8
# Parent  aab7e86cddf34680976fb734d6aa3749ee5d3767
# Available At https://hg.logilab.org/users/lpeuch/logilab-common
#              hg pull https://hg.logilab.org/users/lpeuch/logilab-common -r b1b8320eb626
# EXP-Topic types-annotations-and-cleaning
[py3] file() doesn't exist in python3

diff --git a/logilab/common/daemon.py b/logilab/common/daemon.py
--- a/logilab/common/daemon.py
+++ b/logilab/common/daemon.py
@@ -91,7 +91,7 @@ def daemonize(pidfile=None, uid=None, um
         piddir = os.path.dirname(pidfile)
         if not os.path.exists(piddir):
             os.makedirs(piddir)
-        f = file(pidfile, "w")
+        f = open(pidfile, "w")
         f.write(str(os.getpid()))
         f.close()
     # set umask if specified




More information about the cubicweb-devel mailing list