Skip to content

Commit bfbdaaf

Browse files
committed
Merge remote-tracking branch 'ghsa/windows-programdata'
2 parents 8aae9a3 + 5bef67f commit bfbdaaf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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)