]> granicus.if.org Git - python/commit
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236)
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 25 Mar 2018 13:43:50 +0000 (23:43 +1000)
committerGitHub <noreply@github.com>
Sun, 25 Mar 2018 13:43:50 +0000 (23:43 +1000)
commitee3784594b33c72c3fdca6a71892d22f14045ab6
tree3b90c02aa8be77e61a5a3296de164a3fe2770cbd
parent5666a55da89491bae717e67ad098ac31e310a8e1
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236)

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.

(cherry picked from commit d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b)
Doc/library/test.rst
Doc/whatsnew/3.7.rst
Lib/test/support/script_helper.py
Lib/test/test_bdb.py
Lib/test/test_cmd_line_script.py
Lib/test/test_doctest.py
Lib/test/test_import/__init__.py
Misc/NEWS.d/next/Core and Builtins/2018-03-25-19-49-06.bpo-33053.V3xlsH.rst [new file with mode: 0644]
Python/pathconfig.c