Skip to content

Commit

Permalink
Force python to output utf8 (#429)
Browse files Browse the repository at this point in the history
* Force python to output utf8

* Move to python command calls
  • Loading branch information
pythongosssss authored Dec 4, 2024
1 parent 54f1a96 commit 7428b46
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion forge.env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare global {
viteDevServers: Record<string, import('vite').ViteDevServer>;
}
interface ProcessEnv {
PUBLISH: boolean;
PUBLISH: string;
APPLE_ID: string;
APPLE_PASSWORD: string;
APPLE_TEAM_ID: string;
Expand Down
18 changes: 16 additions & 2 deletions src/virtualEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ export class VirtualEnvironment {
? path.join(this.venvPath, 'Scripts', 'python.exe')
: path.join(this.venvPath, 'bin', 'python');

return this.runCommand(pythonInterpreterPath, args, {}, callbacks);
return this.runCommand(
pythonInterpreterPath,
args,
{
PYTHONIOENCODING: 'utf-8',
},
callbacks
);
}

/**
Expand All @@ -187,7 +194,14 @@ export class VirtualEnvironment {
args: string[],
callbacks?: ProcessCallbacks
): Promise<{ exitCode: number | null }> {
return this.runCommandAsync(this.pythonInterpreterPath, args, {}, callbacks);
return this.runCommandAsync(
this.pythonInterpreterPath,
args,
{
PYTHONIOENCODING: 'utf-8',
},
callbacks
);
}

/**
Expand Down

0 comments on commit 7428b46

Please sign in to comment.