Title: Handling of paths in first argument of imp.find_module()
Type: Stage:
Components: Documentation, Interpreter Core Versions: Python 3.2, Python 3.3, Python 2.7
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Arfrever, brett.cannon, docs@python, ezio.melotti, ncoghlan
Priority: normal Keywords:

Created on 2011-09-25 21:05 by Arfrever, last changed 2013-01-25 19:33 by brett.cannon. This issue is now closed.

Messages (2)
msg144532 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2011-09-25 21:05
It's undocumented that imp.find_module() supports paths with "/" as the first argument:

$ mkdir /tmp/imp_tests
$ cd /tmp/imp_tests
$ mkdir a
$ touch a/
$ python3.3 -c 'import imp; print(imp.find_module("a/b"))'
(<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, 'a/', ('.py', 'U', 1))
msg144544 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-09-26 18:03
It's probably not a bad thing it's undocumented either since importing by file path was removed in Python 3, so this is another case where imp.find_module() differentiates from __import__.
Date User Action Args
2013-01-25 19:33:15brett.cannonsetstatus: open -> closed
resolution: wont fix
2011-09-26 18:03:50brett.cannonsetmessages: + msg144544
2011-09-25 21:05:33Arfrevercreate