Skip to content

Commit 8f224ab

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: Fix typo in completion details (#396) Fix encoding (#394)
2 parents 2c19004 + 714ea52 commit 8f224ab

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client/common/process/proc.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export class ProcessService implements IProcessService {
2222

2323
// Always ensure we have unbuffered output.
2424
spawnOptions.env.PYTHONUNBUFFERED = '1';
25+
if (!spawnOptions.env.PYTHONIOENCODING) {
26+
spawnOptions.env.PYTHONIOENCODING = 'utf-8';
27+
}
2528

2629
const proc = spawn(file, args, spawnOptions);
2730
let procExited = false;
@@ -78,7 +81,9 @@ export class ProcessService implements IProcessService {
7881

7982
// Always ensure we have unbuffered output.
8083
spawnOptions.env.PYTHONUNBUFFERED = '1';
81-
84+
if (!spawnOptions.env.PYTHONIOENCODING) {
85+
spawnOptions.env.PYTHONIOENCODING = 'utf-8';
86+
}
8287
const proc = spawn(file, args, spawnOptions);
8388
const deferred = createDeferred<ExecutionResult<string>>();
8489
const disposables: Disposable[] = [];

src/client/providers/itemInfoSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class ItemInfoSource {
117117
}
118118

119119
const descriptionWithHighlightedCode = this.highlightCode(dnd[1]);
120-
const tooltip = new vscode.MarkdownString(['y```python', signature, '```', descriptionWithHighlightedCode].join(EOL));
120+
const tooltip = new vscode.MarkdownString(['```python', signature, '```', descriptionWithHighlightedCode].join(EOL));
121121
infos.push(new LanguageItemInfo(tooltip, dnd[0], new vscode.MarkdownString(dnd[1])));
122122

123123
const key = signature + lines.join('');

src/test/common/process/proc.exec.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ suite('ProcessService', () => {
3232
expect(result.stderr).to.equal(undefined, 'stderr not undefined');
3333
});
3434

35+
test('exec should output print unicode characters', async () => {
36+
const procService = new ProcessService(new BufferDecoder());
37+
const printOutput = 'öä';
38+
const result = await procService.exec(pythonPath, ['-c', `print(u"${printOutput}")`]);
39+
40+
expect(result).not.to.be.an('undefined', 'result is undefined');
41+
expect(result.stdout.trim()).to.be.equal(printOutput, 'Invalid output');
42+
expect(result.stderr).to.equal(undefined, 'stderr not undefined');
43+
});
44+
3545
test('exec should wait for completion of program with new lines', async function () {
3646
// tslint:disable-next-line:no-invalid-this
3747
this.timeout(5000);

src/test/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ const options: MochaSetupOptions & { retries: number } = {
1212
ui: 'tdd',
1313
useColors: true,
1414
timeout: 25000,
15-
retries: 3,
16-
grep: 'Autocomplete'
15+
retries: 3
1716
};
1817
testRunner.configure(options);
1918
module.exports = testRunner;

0 commit comments

Comments
 (0)