pylockfile
pylockfile copied to clipboard
Context manager lock can persist when program is interrupted
Hi,
I've noticed that if my program receives a KeyboardInterrupt at some point when it's in a with Lockfile(filename)
context, the lockfile can persist on disk. This seems to be a known issue with some contexts (at least the open
function has the issue). See relevant PEP, which is deferred: https://www.python.org/dev/peps/pep-0419/#interruption-inside-with-statement-expression .
It would be ideal if pylockfile handled this issue internally, so that lockfiles did not persist on disk after the lock-acquiring program exits.