File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ export class ProcessService implements IProcessService {
1515 constructor ( @inject ( IBufferDecoder ) private decoder : IBufferDecoder ) { }
1616 public execObservable ( file : string , args : string [ ] , options : SpawnOptions = { } ) : ObservableExecutionResult < string > {
1717 const encoding = options . encoding = typeof options . encoding === 'string' && options . encoding . length > 0 ? options . encoding : DEFAULT_ENCODING ;
18+ delete options . encoding ;
1819 const spawnOptions = { ...options } ;
1920 if ( ! spawnOptions . env || Object . keys ( spawnOptions ) . length === 0 ) {
20- spawnOptions . env = process . env ;
21+ spawnOptions . env = { ... process . env } ;
2122 }
2223
2324 // Always ensure we have unbuffered output.
@@ -74,9 +75,10 @@ export class ProcessService implements IProcessService {
7475 }
7576 public async exec ( file : string , args : string [ ] , options : SpawnOptions = { } ) : Promise < ExecutionResult < string > > {
7677 const encoding = options . encoding = typeof options . encoding === 'string' && options . encoding . length > 0 ? options . encoding : DEFAULT_ENCODING ;
78+ delete options . encoding ;
7779 const spawnOptions = { ...options } ;
7880 if ( ! spawnOptions . env || Object . keys ( spawnOptions ) . length === 0 ) {
79- spawnOptions . env = process . env ;
81+ spawnOptions . env = { ... process . env } ;
8082 }
8183
8284 // Always ensure we have unbuffered output.
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ suite('ProcessService', () => {
3535 test ( 'exec should output print unicode characters' , async ( ) => {
3636 const procService = new ProcessService ( new BufferDecoder ( ) ) ;
3737 const printOutput = 'öä' ;
38- const result = await procService . exec ( pythonPath , [ '-c' , `print(u "${ printOutput } ")` ] ) ;
38+ const result = await procService . exec ( pythonPath , [ '-c' , `print("${ printOutput } ")` ] ) ;
3939
4040 expect ( result ) . not . to . be . an ( 'undefined' , 'result is undefined' ) ;
4141 expect ( result . stdout . trim ( ) ) . to . be . equal ( printOutput , 'Invalid output' ) ;
You can’t perform that action at this time.
0 commit comments