[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__)"

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>

More information about the New-bugs-announce mailing list