
June 17, 2014
noon
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 <report@bugs.python.org> <http://bugs.python.org/issue21784> _______________________________________