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: Unexpected behavior of imp.find_module(".") with a package present in sys.path and also referenced in a .pth file
Type: Stage:
Components: Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever
Priority: normal Keywords:

Created on 2011-09-25 07:08 by Arfrever, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg144519 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2011-09-25 07:08
# python3.3 -c 'import imp; print(imp.find_module("."))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named '.'
# mkdir /usr/lib64/python3.3/site-packages/something
# touch /usr/lib64/python3.3/site-packages/something/__init__.py
# echo something > /usr/lib64/python3.3/site-packages/something.pth
# python3.3 -c 'import imp; print(imp.find_module("."))'
(None, '/usr/lib64/python3.3/site-packages/something/.', ('', '', 5))
msg144520 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2011-09-25 07:56
After thinking more about it, it's probably expected.
History
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57252
2011-09-25 07:56:41Arfreversetstatus: open -> closed
resolution: not a bug
messages: + msg144520
2011-09-25 07:08:28Arfrevercreate