Skip to content

Commit 23725ab

Browse files
IPyKernel install issue with windows paths (#13667)
* Both changes * remove args change * Remove logging message * Add news * remove logMessage imports * Update python.ts * Fix unit tests * Actually fix the unit tests Co-authored-by: Rich Chiodo <[email protected]>
1 parent 49f160a commit 23725ab

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

news/2 Fixes/13493.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix path to isolated script on Windows shell_exec.

src/client/common/process/internal/python.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function execCode(code: string, isolated = true): string[] {
2828
export function execModule(name: string, moduleArgs: string[], isolated = true): string[] {
2929
const args = ['-m', name, ...moduleArgs];
3030
if (isolated) {
31-
args[0] = ISOLATED; // replace
31+
args[0] = ISOLATED.fileToCommandArgument();
3232
}
3333
// "code" isn't specific enough to know how to parse it,
3434
// so we only return the args.

src/client/common/process/internal/scripts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export function shell_exec(command: string, lockfile: string, shellArgs: string[
306306
// We don't bother with a "parse" function since the output
307307
// could be anything.
308308
return [
309-
ISOLATED,
309+
ISOLATED.fileToCommandArgument(),
310310
script,
311311
command.fileToCommandArgument(),
312312
// The shell args must come after the command

src/test/common/moduleInstaller.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ import { closeActiveWindows, initializeTest } from './../initialize';
140140

141141
chai_use(chaiAsPromised);
142142

143-
const isolated = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'pythonFiles', 'pyvsc-run-isolated.py');
143+
const isolated = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'pythonFiles', 'pyvsc-run-isolated.py').replace(/\\/g, '/');
144144

145145
const info: PythonEnvironment = {
146146
architecture: Architecture.Unknown,

0 commit comments

Comments
 (0)