[New-bugs-announce] [issue14052] importlib mixes up '.' and os.getcwd()

Antoine Pitrou report at bugs.python.org
Sat Feb 18 21:38:47 CET 2012


New submission from Antoine Pitrou <pitrou at free.fr>:

An empty sys.path string means the current directory in relative terms:

$ touch foo.py
$ python3 -c "import foo; print(foo.__file__)"
foo.py


But importlib uses os.getcwd() instead in PathFinder._path_importer_cache(). This impacts semantics of path searching, as well as the values of __file__ and __cached__ attributes.

----------
assignee: brett.cannon
components: Library (Lib)
messages: 153656
nosy: brett.cannon, pitrou
priority: normal
severity: normal
status: open
title: importlib mixes up '.' and os.getcwd()
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14052>
_______________________________________


More information about the New-bugs-announce mailing list