Message263042
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())) |
|
Date |
User |
Action |
Args |
2016-04-08 19:50:33 | Jack Zhou | set | recipients:
+ Jack Zhou |
2016-04-08 19:50:33 | Jack Zhou | set | messageid: <1460145033.33.0.165294517839.issue26716@psf.upfronthosting.co.za> |
2016-04-08 19:50:33 | Jack Zhou | link | issue26716 messages |
2016-04-08 19:50:33 | Jack Zhou | create | |
|