Skip to content

Commit 8d337a7

Browse files
authored
Cherry pick to address path issues. (#14125)
* 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)
1 parent 0b41a86 commit 8d337a7

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

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.fileToCommandArgument();
31+
args[0] = ISOLATED; // replace
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.fileToCommandArgument(),
309+
ISOLATED,
310310
script,
311311
command.fileToCommandArgument(),
312312
// The shell args must come after the command

src/test/common/installer/moduleInstaller.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { IServiceContainer } from '../../../client/ioc/types';
4747
import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info';
4848
import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants';
4949

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

5252
/* Complex test to ensure we cover all combinations:
5353
We could have written separate tests for each installer, but we'd be replicate code.

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').replace(/\\/g, '/');
143+
const isolated = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'pythonFiles', 'pyvsc-run-isolated.py');
144144

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

src/test/common/process/pythonProcess.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IProcessService, StdErrError } from '../../../client/common/process/typ
1212
import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants';
1313
import { noop } from '../../core';
1414

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

1717
use(chaiAsPromised);
1818

src/test/common/terminals/synchronousTerminalService.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ suite('Terminal Service (synchronous)', () => {
6767
});
6868
});
6969
suite('sendCommand', () => {
70-
const isolated = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py').replace(/\\/g, '/');
70+
const isolated = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py');
7171
const shellExecFile = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'shell_exec.py');
7272

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

0 commit comments

Comments
 (0)