[docs] [issue21784] __init__.py can be a directory
report at bugs.python.org
Tue Jun 17 18:00:59 CEST 2014
STINNER Victor added the comment:
I remember that I added an check in Python 3.2 on the file type to explicitly reject directories:
+ if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
+ /* it's a directory */
+ fp = NULL;
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 at bugs.python.org>
More information about the docs