You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2009-04-05.16:33:04.504>created_at=<Date2009-02-26.15:56:32.851>labels= ['interpreter-core']
title='Wrong ImportError message if module is not readable'updated_at=<Date2009-04-05.16:33:04.503>user='https://github.com/vstinner'
__import__() raises an ImportError "No module named ..." if the module
file is not readable or module directory is not executable. The
expected message is something like "Module named ... is not readable".
Directory tree for the test:
------------------------------
marge$ ls -lRF .
.:
drwxrwxrwx 2 haypo haypo 4096 2009-02-26 16:51 module/
-rw-rw-rw- 1 haypo haypo 9 2009-02-26 16:48 module2.py
-rw-r--r-- 1 haypo haypo 414 2009-02-26 16:50 test.py
Success with correct file permissions:
------------------------------
$ python test.py
__import__('/home/haypo/xxx/module') ...
PI = 3.14
__import__('/home/haypo/xxx/module2') ...
E = 2.72
Change module/ and module2.py permissions to 000 (no read, no write,
no execute):
------------------------------
__import__('/home/haypo/xxx/module') ...
No module named /home/haypo/xxx/module
__import__('/home/haypo/xxx/module2') ...
No module named /home/haypo/xxx/module2
------------------------------
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: