diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2018-03-25 13:03:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-25 13:03:10 (GMT) |
commit | d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b (patch) | |
tree | c3c02b573a85d3a5caa61e1dd5188ba6bec36392 /Misc/NEWS.d/next | |
parent | bc77eff8b96be4f035e665ab35c1d06e22f46491 (diff) | |
download | cpython-d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b.zip cpython-d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b.tar.gz cpython-d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b.tar.bz2 |
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231)
Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.
This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.
Diffstat (limited to 'Misc/NEWS.d/next')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-49-06.bpo-33053.V3xlsH.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-49-06.bpo-33053.V3xlsH.rst b/Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-49-06.bpo-33053.V3xlsH.rst new file mode 100644 index 0000000..fd32ac1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-49-06.bpo-33053.V3xlsH.rst @@ -0,0 +1,4 @@ +When using the -m switch, sys.path[0] is now explicitly expanded as the +*starting* working directory, rather than being left as the empty path +(which allows imports from the current working directory at the time of the +import) |