@@ -185,30 +185,24 @@ export async function resolvePythonEntryPoint(
185185 // Fallback: look for __main__.py
186186 const mainPath = path . join ( tempDir , '__main__.py' ) ;
187187 if ( await fileExists ( mainPath ) ) {
188- // Use venv Python if available
189- const venvPython = path . join ( tempDir , '.venv' , 'bin' , 'python' ) ;
190- const command = await fileExists ( venvPython ) ? venvPython : 'python3' ;
191- return { command, entryPoint : mainPath } ;
188+ // Use system python3 (security validated, venv packages available via working directory)
189+ return { command : 'python3' , entryPoint : mainPath } ;
192190 }
193191
194192 // Try src/__main__.py (common pattern)
195193 const srcMainPath = path . join ( tempDir , 'src' , '__main__.py' ) ;
196194 if ( await fileExists ( srcMainPath ) ) {
197- // Use venv Python if available
198- const venvPython = path . join ( tempDir , '.venv' , 'bin' , 'python' ) ;
199- const command = await fileExists ( venvPython ) ? venvPython : 'python3' ;
200- return { command, entryPoint : srcMainPath } ;
195+ // Use system python3 (security validated, venv packages available via working directory)
196+ return { command : 'python3' , entryPoint : srcMainPath } ;
201197 }
202198
203199 // Try common script names (server.py, main.py, app.py, run.py)
204200 const commonScriptNames = [ 'server.py' , 'main.py' , 'app.py' , 'run.py' ] ;
205201 for ( const scriptName of commonScriptNames ) {
206202 const scriptPath = path . join ( tempDir , scriptName ) ;
207203 if ( await fileExists ( scriptPath ) ) {
208- // Use venv Python if available
209- const venvPython = path . join ( tempDir , '.venv' , 'bin' , 'python' ) ;
210- const command = await fileExists ( venvPython ) ? venvPython : 'python3' ;
211- return { command, entryPoint : scriptPath } ;
204+ // Use system python3 (security validated, venv packages available via working directory)
205+ return { command : 'python3' , entryPoint : scriptPath } ;
212206 }
213207 }
214208
0 commit comments