New submission from Arfrever Frehtes Taifersar Arahesis <arfrever....@gmail.com>:
imp.find_module() can find files, which cannot be imported. I suggest that imp.find_module() raise an exception in such cases. $ cd /tmp $ touch .something.py $ python3.3 Python 3.3.0a0 (default:5e456e1a9e8c+, Sep 25 2011, 18:57:23) [GCC 4.5.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import .something File "<stdin>", line 1 import .something ^ SyntaxError: invalid syntax >>> module = __import__(".something") Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: Empty module name >>> import imp >>> file, pathname, description = imp.find_module(".something") >>> file, pathname, description (<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, '.something.py', ('.py', 'U', 1)) ---------- components: Interpreter Core messages: 144527 nosy: Arfrever priority: normal severity: normal status: open title: imp.find_module() should not find unimportable modules versions: Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13046> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com