[issue3115] os.listdir randomly fails on occasions when it shouldn't

philipspencer report at bugs.python.org
Mon Jun 16 16:37:31 CEST 2008


philipspencer <pspencer at fields.utoronto.ca> added the comment:

Yes, it is the same issue. Sorry I didn't see the previous report -- I
didn't imagine an issue like this, with such a simple fix, could have
been reported back in 2006 without the fix ever having been implemented,
so I didn't bother searching back that far!

The fix in that report contains the same one-line fix as I proposed,
plus additional changes to ensure that the code won't break if in
the future additional changes are made to allow a second possible
exit-out-of-the-loop-with-d-being-non-null code path.

All that's strictly necessary to solve the current problem is the
one line I proposed, but the other proposed changes would make the
safer against future potential breakage if the code gets rearranged
later.

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


More information about the Python-bugs-list mailing list