[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2021-06-23 Thread Irit Katriel
Irit Katriel added the comment: Geoff, it's been over two years. Do you think there is a chance you will want to follow up with a reproducer, or shall we close this issue? -- nosy: +iritkatriel status: pending -> open ___ Python tracker

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
Change by Geoff Alexander : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
Geoff Alexander 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 Stac

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: > How can this happen? Easily -- this looks like a "Time Of Check To Time Of Use" bug. You check for the existence of a directory, and then a fraction of a second later you attempt to use that directory. But on a multi-processing operating system like Windo

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
Change by Geoff Alexander : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
New submission from Geoff Alexander : I have the following code: ``` def handle_empty_directories(dir): if os.path.exists(dir): shouter.shout("%s exists" % dir) else: shouter.shout("%s doesn't exists" % dir) entries = os.listdir(dir) if