Evgeny Kapun added the comment: Simple test: while True: try: listdir(0) except NotADirectoryError: pass ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue17899> _______________________________________