Skip to content

Commit 8daab65

Browse files
committed
Force UTF-8 for Hindsight sidecar commands
1 parent 6650875 commit 8daab65

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/hindsight/managed.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,17 @@ impl EmbeddedHindsightSidecar {
142142
}
143143

144144
fn command(&self) -> Command {
145-
Command::new(&self.executable)
145+
let mut command = Command::new(&self.executable);
146+
configure_sidecar_process_env(&mut command);
147+
command
146148
}
147149
}
148150

151+
fn configure_sidecar_process_env(command: &mut Command) {
152+
command.env("PYTHONUTF8", "1");
153+
command.env("PYTHONIOENCODING", "utf-8");
154+
}
155+
149156
async fn sidecar_install_is_valid(root: &Path, expected: &SidecarInstallMetadata) -> bool {
150157
let metadata_path = root.join(SIDECAR_METADATA_FILE);
151158
let bytes = match tokio::fs::read(&metadata_path).await {

xtask/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,8 @@ fn run_sidecar_command<const N: usize>(
683683
command.env("HOME", home);
684684
command.env("USERPROFILE", home);
685685
}
686+
command.env("PYTHONUTF8", "1");
687+
command.env("PYTHONIOENCODING", "utf-8");
686688
let status = command.status()?;
687689
if status.success() {
688690
Ok(())

0 commit comments

Comments
 (0)