On 30/04/23 2:43 am, jak wrote:
Maybe I expressed myself badly but I didn't mean to propose alternatives to the EAFP way but just to evaluate the possibility that it is not a folder.
If it's not a folder, you'll find out when the next thing you try to do to it fails. You could check for it earlier, but there's still the possibility of a race condition -- someone could delete the folder and replace it with a file in the meantime. Or just delete it and not replace it with anything. So you need to be prepared to deal with failures at any point. -- Greg -- https://mail.python.org/mailman/listinfo/python-list