pylockfile icon indicating copy to clipboard operation
pylockfile copied to clipboard

Context manager lock can persist when program is interrupted

Open nrhinehart opened this issue 6 years ago • 0 comments

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.

nrhinehart avatar Mar 05 '18 18:03 nrhinehart