New submission from Jack Zhou: According to PEP 475, standard library modules should handle EINTR, but this appears to not be the case for the fcntl module.
Test script: import fcntl import signal import os def handle_alarm(signum, frame): print("Received alarm in process {}!".format(os.getpid())) child = os.fork() if child: signal.signal(signal.SIGALRM, handle_alarm) signal.alarm(1) with open("foo", "w") as f: print("Locking in process {}...".format(os.getpid())) fcntl.flock(f, fcntl.LOCK_EX) print("Locked in process {}.".format(os.getpid())) os.waitpid(child, 0) else: signal.signal(signal.SIGALRM, handle_alarm) signal.alarm(1) with open("foo", "w") as f: print("Locking in process {}...".format(os.getpid())) fcntl.flock(f, fcntl.LOCK_EX) print("Locked in process {}.".format(os.getpid())) ---------- components: IO messages: 263042 nosy: Jack Zhou priority: normal severity: normal status: open title: EINTR handling in fcntl type: behavior versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26716> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com