Staging
v0.8.1
https://github.com/python/cpython
Revision 27e27f7ee1f366e52cfd576b427e923190b6202e authored by Brett Cannon on 18 October 2013, 15:39:04 UTC, committed by Brett Cannon on 18 October 2013, 15:39:04 UTC
and stop importlib.machinery.FileFinder treating '' as '.'.

Previous PathFinder transformed '' into '.' which led to __file__ for
modules imported from the cwd to always be relative paths. This meant
the values of the attribute were wrong as soon as the cwd changed.
This change now means that as long as the site module is run (which
makes all entries in sys.path absolute) then all values for __file__
will also be absolute unless it's for __main__ when specified by file
path in a relative way (modules imported by runpy will have an
absolute path).

Now that PathFinder is no longer treating '' as '.' it only makes
sense for FileFinder to stop doing so as well. Now no transformation
is performed for the directory given to the __init__ method.

Thanks to Madison May for the initial patch.
1 parent 40b22d0
History
Tip revision: 27e27f7ee1f366e52cfd576b427e923190b6202e authored by Brett Cannon on 18 October 2013, 15:39:04 UTC
Issue #18416: Have importlib.machinery.PathFinder treat '' as the cwd
Tip revision: 27e27f7
File Mode Size
_bz2.vcxproj -rw-r--r-- 14.3 KB
_bz2.vcxproj.filters -rw-r--r-- 1.7 KB
_ctypes.vcxproj -rw-r--r-- 16.5 KB
_ctypes.vcxproj.filters -rw-r--r-- 2.3 KB
_ctypes_test.vcxproj -rw-r--r-- 10.6 KB
_ctypes_test.vcxproj.filters -rw-r--r-- 718 bytes
_decimal.vcxproj -rw-r--r-- 17.6 KB
_decimal.vcxproj.filters -rw-r--r-- 4.3 KB
_elementtree.vcxproj -rw-r--r-- 15.0 KB
_elementtree.vcxproj.filters -rw-r--r-- 2.5 KB
_freeze_importlib.vcxproj -rw-r--r-- 8.4 KB
_freeze_importlib.vcxproj.filters -rw-r--r-- 1.1 KB
_hashlib.vcxproj -rw-r--r-- 14.5 KB
_hashlib.vcxproj.filters -rw-r--r-- 436 bytes
_lzma.vcxproj -rw-r--r-- 14.6 KB
_lzma.vcxproj.filters -rw-r--r-- 435 bytes
_msi.vcxproj -rw-r--r-- 12.3 KB
_msi.vcxproj.filters -rw-r--r-- 423 bytes
_multiprocessing.vcxproj -rw-r--r-- 12.4 KB
_multiprocessing.vcxproj.filters -rw-r--r-- 861 bytes
_overlapped.vcxproj -rw-r--r-- 13.0 KB
_sha3.vcxproj -rw-r--r-- 11.8 KB
_socket.vcxproj -rw-r--r-- 12.3 KB
_socket.vcxproj.filters -rw-r--r-- 702 bytes
_sqlite3.vcxproj -rw-r--r-- 14.6 KB
_sqlite3.vcxproj.filters -rw-r--r-- 2.4 KB
_ssl.vcxproj -rw-r--r-- 14.8 KB
_ssl.vcxproj.filters -rw-r--r-- 428 bytes
_testbuffer.vcxproj -rw-r--r-- 11.4 KB
_testbuffer.vcxproj.filters -rw-r--r-- 435 bytes
_testcapi.vcxproj -rw-r--r-- 11.5 KB
_testcapi.vcxproj.filters -rw-r--r-- 439 bytes
_testimportmultiple.vcxproj -rw-r--r-- 11.5 KB
_testimportmultiple.vcxproj.filters -rw-r--r-- 444 bytes
_tkinter.vcxproj -rw-r--r-- 13.9 KB
_tkinter.vcxproj.filters -rw-r--r-- 534 bytes
bdist_wininst.vcxproj -rw-r--r-- 8.6 KB
bdist_wininst.vcxproj.filters -rw-r--r-- 2.2 KB
build.bat -rw-r--r-- 551 bytes
build_env.bat -rw-r--r-- 25 bytes
build_pgo.bat -rw-r--r-- 1.1 KB
build_ssl.bat -rw-r--r-- 253 bytes
build_ssl.py -rw-r--r-- 9.0 KB
build_tkinter.py -rw-r--r-- 2.1 KB
debug.props -rw-r--r-- 956 bytes
env.bat -rw-r--r-- 255 bytes
field3.py -rw-r--r-- 974 bytes
idle.bat -rw-r--r-- 284 bytes
installer.bmp -rw-r--r-- 57.4 KB
kill_python.c -rw-r--r-- 5.5 KB
kill_python.vcxproj -rw-r--r-- 6.1 KB
kill_python.vcxproj.filters -rw-r--r-- 424 bytes
make_buildinfo.c -rw-r--r-- 6.8 KB
make_buildinfo.vcxproj -rw-r--r-- 2.5 KB
make_buildinfo.vcxproj.filters -rw-r--r-- 497 bytes
make_versioninfo.vcxproj -rw-r--r-- 9.3 KB
make_versioninfo.vcxproj.filters -rw-r--r-- 435 bytes
pcbuild.sln -rw-r--r-- 49.9 KB
pginstrument.props -rw-r--r-- 1.6 KB
pgupdate.props -rw-r--r-- 737 bytes
pyd.props -rw-r--r-- 859 bytes
pyd_d.props -rw-r--r-- 1.1 KB
pyexpat.vcxproj -rw-r--r-- 13.9 KB
pyexpat.vcxproj.filters -rw-r--r-- 1.1 KB
pylauncher.vcxproj -rw-r--r-- 15.2 KB
pylauncher.vcxproj.filters -rw-r--r-- 1.2 KB
pyproject.props -rw-r--r-- 4.4 KB
python.vcxproj -rw-r--r-- 17.9 KB
python.vcxproj.filters -rw-r--r-- 822 bytes
python3dll.vcxproj -rw-r--r-- 13.9 KB
python3dll.vcxproj.filters -rw-r--r-- 1.2 KB
pythoncore.vcxproj -rw-r--r-- 36.6 KB
pythoncore.vcxproj.filters -rw-r--r-- 30.1 KB
pythonw.vcxproj -rw-r--r-- 17.1 KB
pythonw.vcxproj.filters -rw-r--r-- 702 bytes
pywlauncher.vcxproj -rw-r--r-- 12.0 KB
pywlauncher.vcxproj.filters -rw-r--r-- 1.2 KB
readme.txt -rw-r--r-- 14.8 KB
release.props -rw-r--r-- 629 bytes
rmpyc.py -rw-r--r-- 598 bytes
rt.bat -rw-r--r-- 1.8 KB
select.vcxproj -rw-r--r-- 13.0 KB
select.vcxproj.filters -rw-r--r-- 436 bytes
sqlite3.props -rw-r--r-- 712 bytes
sqlite3.vcxproj -rw-r--r-- 12.6 KB
sqlite3.vcxproj.filters -rw-r--r-- 804 bytes
ssl.vcxproj -rw-r--r-- 16.0 KB
unicodedata.vcxproj -rw-r--r-- 11.6 KB
unicodedata.vcxproj.filters -rw-r--r-- 810 bytes
vs9to10.py -rw-r--r-- 2.2 KB
vs9to8.py -rw-r--r-- 1.3 KB
winsound.vcxproj -rw-r--r-- 11.8 KB
winsound.vcxproj.filters -rw-r--r-- 500 bytes
x64.props -rw-r--r-- 754 bytes
xxlimited.vcxproj -rw-r--r-- 10.6 KB
xxlimited.vcxproj.filters -rw-r--r-- 433 bytes

readme.txt

back to top