On Mon, Feb 24, 2020 at 11:51 AM Brianvanderburg2 via Python-ideas < firstname.lastname@example.org> wrote:
When running a python script directly, the directory of that script gets added to sys.path. When running as a module "python -m", it looks like an empty string gets added to sys.path, which appears to result in CWD being used.
Are you familiar with the -I option for "isolated mode"? https://docs.python.org/3/using/cmdline.html#id2
-I Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory. All PYTHON* environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code. New in version 3.4.