oss-sec mailing list archives
Re: ipython3 may execute code from the current working directory
From: Jakub Wilk <jwilk () jwilk net>
Date: Sat, 24 Jul 2021 18:59:55 +0200
* Mats Wichmann <mats () wichmann us>, 2021-07-23, 14:39:
https://github.com/ipython/ipython/blob/7.25.0/IPython/core/shellapp.py#L219normally (cpython), an empty string in sys.path doesn't mean "current directory", it means "script directory", the directory the script you're running is found in [1].
No, empty string in sys.path always means cwd.sys.path[0] is the script directory (if available), but that's a non-empty string.
But you might be right that this is IPython's failure to mimic how the normal Python interpreter initializes sys.path.
-- Jakub Wilk
Current thread:
- ipython3 may execute code from the current working directory Georgi Guninski (Jul 22)
- Re: ipython3 may execute code from the current working directory Jakub Wilk (Jul 22)
- Re: ipython3 may execute code from the current working directory Jakub Wilk (Jul 22)
- Re: ipython3 may execute code from the current working directory Jakub Wilk (Jul 23)
- Re: ipython3 may execute code from the current working directory Mats Wichmann (Jul 23)
- Re: ipython3 may execute code from the current working directory Jakub Wilk (Jul 24)
- Re: ipython3 may execute code from the current working directory Georgi Guninski (Jul 25)
- Re: ipython3 may execute code from the current working directory Jakub Wilk (Jul 22)