Skip to content

Commit

Permalink
IPyKernel install issue with windows paths (#13667)
Browse files Browse the repository at this point in the history
* 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 <rchiodo@users.noreply.github.com>
  • Loading branch information
IanMatthewHuff and rchiodo authored Sep 4, 2020
1 parent 49f160a commit 23725ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/13493.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix path to isolated script on Windows shell_exec.
2 changes: 1 addition & 1 deletion src/client/common/process/internal/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function execCode(code: string, isolated = true): string[] {
export function execModule(name: string, moduleArgs: string[], isolated = true): string[] {
const args = ['-m', name, ...moduleArgs];
if (isolated) {
args[0] = ISOLATED; // replace
args[0] = ISOLATED.fileToCommandArgument();
}
// "code" isn't specific enough to know how to parse it,
// so we only return the args.
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/process/internal/scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export function shell_exec(command: string, lockfile: string, shellArgs: string[
// We don't bother with a "parse" function since the output
// could be anything.
return [
ISOLATED,
ISOLATED.fileToCommandArgument(),
script,
command.fileToCommandArgument(),
// The shell args must come after the command
Expand Down
2 changes: 1 addition & 1 deletion src/test/common/moduleInstaller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import { closeActiveWindows, initializeTest } from './../initialize';

chai_use(chaiAsPromised);

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

const info: PythonEnvironment = {
architecture: Architecture.Unknown,
Expand Down

0 comments on commit 23725ab

Please sign in to comment.