Skip to content

Commit

Permalink
Cherry pick to address path issues. (#14125)
Browse files Browse the repository at this point in the history
* Do not quote isolated in exec module (#14108)

* Do not quote isolated in exec module

* Revert "Do not quote isolated in exec module"

This reverts commit b9fa04c.

* Revert "IPyKernel install issue with windows paths (#13667)"

This reverts commit 23725ab.

* Fix unit test broken by recent revert (#14122)
  • Loading branch information
karthiknadig authored Sep 28, 2020
1 parent 0b41a86 commit 8d337a7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
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.fileToCommandArgument();
args[0] = ISOLATED; // replace
}
// "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.fileToCommandArgument(),
ISOLATED,
script,
command.fileToCommandArgument(),
// The shell args must come after the command
Expand Down
2 changes: 1 addition & 1 deletion src/test/common/installer/moduleInstaller.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { IServiceContainer } from '../../../client/ioc/types';
import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info';
import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants';

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

/* Complex test to ensure we cover all combinations:
We could have written separate tests for each installer, but we'd be replicate code.
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').replace(/\\/g, '/');
const isolated = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'pythonFiles', 'pyvsc-run-isolated.py');

const info: PythonEnvironment = {
architecture: Architecture.Unknown,
Expand Down
2 changes: 1 addition & 1 deletion src/test/common/process/pythonProcess.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IProcessService, StdErrError } from '../../../client/common/process/typ
import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants';
import { noop } from '../../core';

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

use(chaiAsPromised);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ suite('Terminal Service (synchronous)', () => {
});
});
suite('sendCommand', () => {
const isolated = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py').replace(/\\/g, '/');
const isolated = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py');
const shellExecFile = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'shell_exec.py');

test('run sendCommand in terminalService if there is no cancellation token', async () => {
Expand Down

0 comments on commit 8d337a7

Please sign in to comment.