Terry J. Reedy added the comment: This is a feature-change 'enhancement' issue. There is no violation of the doc at https://docs.python.org/3/library/os.html#os.listdir and as Raylu noted, the current behavior is accommodated in tests.
I presume that regardless of what system calls are made, FileNotFoundError and anything else could be caught and NotADirectoryError raised instead, with the message containing the Windows error message. This would only break Windows-specific code that only catches FileNotFoundError and not NotADirectoryError. I am not sure what our general policy is and whether this should be fixed at this point. I personally like Python smoothing over OS differences when easily possible. ---------- nosy: +terry.reedy stage: -> test needed type: -> enhancement versions: +Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29366> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com