File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
pythonFiles/vscode_datascience_helpers Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ Fix bandit issues in vscode_datascience_helpers.
Original file line number Diff line number Diff line change 77
88import os
99import sys
10- from subprocess import Popen , PIPE
10+
11+ # See comment at the point of our use of Popen
12+ from subprocess import Popen , PIPE # nosec
1113
1214from ipython_genutils .encoding import getdefaultencoding
1315from ipython_genutils .py3compat import cast_bytes_py2
@@ -151,7 +153,9 @@ def launch_kernel(
151153 env ["JPY_PARENT_PID" ] = str (os .getpid ())
152154
153155 try :
154- proc = Popen (cmd , ** kwargs )
156+ # Popen with shell=False (which is the default) is our safest way to launch a process here
157+ # this cmd does come from the jupyter kernelspec argv, but this is consistent with how jupyter works
158+ proc = Popen (cmd , ** kwargs ) # nosec
155159 except Exception as exc :
156160 msg = (
157161 "Failed to run command:\n {}\n " " PATH={!r}\n " " with kwargs:\n {!r}\n "
You can’t perform that action at this time.
0 commit comments