This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
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
process
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 2022-04-11 14:57 by admin. 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/b.py
$ python3.3 -c 'import imp; print(imp.find_module("a/b"))'
(<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, 'a/b.py', ('.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__.
History
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57257
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