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 7
7
8
8
import os
9
9
import 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
11
13
12
14
from ipython_genutils .encoding import getdefaultencoding
13
15
from ipython_genutils .py3compat import cast_bytes_py2
@@ -151,7 +153,9 @@ def launch_kernel(
151
153
env ["JPY_PARENT_PID" ] = str (os .getpid ())
152
154
153
155
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
155
159
except Exception as exc :
156
160
msg = (
157
161
"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