[issue21742] WatchedFileHandler can fail due to race conditions or file open issues.

Vinay Sajip report at bugs.python.org
Sat Jun 14 11:16:14 CEST 2014


Vinay Sajip added the comment:

There *is* a race condition with WatchedFileHandler - see #14632 - but there is not much that can be done about it (see the various comments in that issue). BTW, I wasn't able to reproduce the threading problem from your script: there were no errors and the file 'foo' contained three lines with 'foo', as expected.

Your suggested fix doesn't seem right, either - the problem is that a failed _open() leaves a closed stream in self.stream, and the correct fix is to set this to None in case the _open fails. But thanks for the suggestion.

----------
versions:  -Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21742>
_______________________________________


More information about the Python-bugs-list mailing list