cpython/Python
Brett Cannon 27e27f7ee1 Issue #18416: Have importlib.machinery.PathFinder treat '' as the cwd
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.
2013-10-18 11:39:04 -04:00
..
_warnings.c Close #11619: The parser and the import machinery do not encode Unicode 2013-08-26 22:28:21 +02:00
asdl.c Issue #4555: All exported C symbols are now prefixed with either "Py" or "_Py". 2013-10-12 22:52:43 +02:00
ast.c Issue #4555: All exported C symbols are now prefixed with either "Py" or "_Py". 2013-10-12 22:52:43 +02:00
bltinmodule.c Issue #18783: Removed existing mentions of Python long type in docstrings, 2013-08-27 20:17:03 +03:00
ceval.c Close #19199: Remove `PyThreadState.tick_counter` field 2013-10-09 14:53:01 +02:00
ceval_gil.h
codecs.c Issue #18722: Remove uses of the "register" keyword in C code. 2013-08-13 20:18:52 +02:00
compile.c Issue #18783: Removed existing mentions of Python long type in docstrings, 2013-08-27 20:17:03 +03:00
condvar.h
dtoa.c
dup2.c
dynamic_annotations.c
dynload_aix.c Issue #18722: Remove uses of the "register" keyword in C code. 2013-08-13 20:18:52 +02:00
dynload_dl.c
dynload_hpux.c
dynload_next.c
dynload_shlib.c merge 3.3 2013-07-22 22:08:17 -07:00
dynload_stub.c
dynload_win.c Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). 2013-06-10 15:38:54 +01:00
errors.c Don't export internal symbols ("make smelly") 2013-10-12 22:41:17 +02:00
fileutils.c Don't export internal symbols ("make smelly") 2013-10-12 22:41:17 +02:00
formatter_unicode.c Issue #18783: Removed existing mentions of Python long type in docstrings, 2013-08-27 20:17:03 +03:00
frozen.c
frozenmain.c Issue #15893: Remove dead code 2013-07-27 02:41:03 +02:00
future.c Close #11619: The parser and the import machinery do not encode Unicode 2013-08-26 22:28:21 +02:00
getargs.c Re #18521: move array bounds check before array access. 2013-10-14 07:01:11 +02:00
getcompiler.c
getcopyright.c
getopt.c
getplatform.c
getversion.c
graminit.c
import.c Issue #18571: Implementation of the PEP 446: file descriptors and file handles 2013-08-28 00:53:59 +02:00
importdl.c Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure 2013-07-17 21:53:23 +02:00
importdl.h
importlib.h Issue #18416: Have importlib.machinery.PathFinder treat '' as the cwd 2013-10-18 11:39:04 -04:00
makeopcodetargets.py
marshal.c Close #19260: remove outdated comment in marshal.c 2013-10-14 20:50:32 +02:00
modsupport.c
mysnprintf.c
mystrtoul.c Issue #18722: Remove uses of the "register" keyword in C code. 2013-08-13 20:18:52 +02:00
opcode_targets.h rather than passing locals to the class body, just execute the class body in the proper environment 2013-05-16 14:37:25 -05:00
peephole.c Issue #18408: Fix PyCode_Optimize(): raise a MemoryError on memory allocation 2013-07-09 00:32:04 +02:00
pyarena.c Issue #18203: Replace malloc() with PyMem_Malloc() to allocate arena objects 2013-07-07 17:18:53 +02:00
pyctype.c
pyfpe.c
pymath.c
pystate.c Close #19199: Remove `PyThreadState.tick_counter` field 2013-10-09 14:53:01 +02:00
pystrcmp.c
pystrtod.c Re #18521: remove assignments of variables that are immediately reassigned. 2013-10-14 06:51:46 +02:00
Python-ast.c Issue #4555: All exported C symbols are now prefixed with either "Py" or "_Py". 2013-10-12 22:52:43 +02:00
pythonrun.c Issue #16129: Py_SetStandardStreamEncoding cleanups 2013-10-18 23:11:47 +10:00
pytime.c
random.c merge with 3.3 2013-10-06 18:48:30 +02:00
sigcheck.c
strdup.c Issue #18722: Remove uses of the "register" keyword in C code. 2013-08-13 20:18:52 +02:00
structmember.c
symtable.c merge 3.3 (#19098) 2013-09-26 22:21:41 -04:00
sysmodule.c #18839: merge with 3.3. 2013-08-26 14:01:29 +03:00
thread.c Issue #18520: Add a new PyStructSequence_InitType2() function, same than 2013-07-22 22:24:54 +02:00
thread_foobar.h
thread_nt.h Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locks 2013-07-07 17:17:59 +02:00
thread_pthread.h Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locks 2013-07-07 17:17:59 +02:00
traceback.c merge 3.3 2013-07-21 13:29:42 -07:00