padraic cunningham added the comment: When the following code snippets are run from two separate shells, the code inside the function does not raise any error on the second call while the second snippet successfully raises a BlockingIOError on the second run:
# No error raised. def func(): lockfile = open('lockfile', 'w') fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB) input() # no error raised, can be sleep etc.. func() # Error raised. lockfile = open('lockfile', 'w') fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB) input() ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27016> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com