Geoff Alexander <[email protected]> added the comment:
This problem does not appear to be a race condition ("Time Of Check To Time Of
Use" bug) in my case as the directory in question exists both before and after
the os.listdir call.
I got a workaround saying to wrap the os.listdir call in try/except in my Stack
Overflow question at
https://stackoverflow.com/questions/55067904/python-os-listdir-fails-with-filenotfounderror-when-directory-exists.
This worked as no longer got any spurious FileNotFound exceptions.
I realize that the code snippet I gave is not runnable. I'll look to put
together a small example illustrating the problem and add to the issue.
----------
status: pending -> open
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36243>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com