Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bef67f

Browse files
committed
windows: require IPYTHON_USE_PROGRAMDATA=1 opt-in to trust programdata
1 parent 2045d5c commit 5bef67f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

IPython/core/application.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
)
3434

3535
if os.name == "nt":
36+
# %PROGRAMDATA% is not safe by default, require opt-in to trust it
3637
programdata = os.environ.get("PROGRAMDATA", None)
37-
if programdata is not None:
38+
if os.environ.get("IPYTHON_USE_PROGRAMDATA") == "1" and programdata is not None:
3839
SYSTEM_CONFIG_DIRS = [str(Path(programdata) / "ipython")]
39-
else: # PROGRAMDATA is not defined by default on XP.
40+
else:
4041
SYSTEM_CONFIG_DIRS = []
4142
else:
4243
SYSTEM_CONFIG_DIRS = [

0 commit comments

Comments
 (0)