STINNER Victor added the comment:

I remember that I added an check in Python 3.2 on the file type to explicitly 
reject directories:
http://hg.python.org/cpython/rev/125887a41a6f

+            if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
+                /* it's a directory */
+                fp = NULL;
+            else

I wrote this change in the C code, I didn't report the change to the Python 
code (importlib).

A huge work was also done in importlib to reduce the number of calls to stat(). 
So maybe a check was dropped by mistake?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21784>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to