uv/crates/uv-build-frontend
Jiahao Yuan fce7a838e9
Fix stream did not contain valid UTF-8 (#8120)
## Summary

Related issues: #8009 #7549

Although `PYTHONIOENCODING=utf-8` forces python to use UTF-8 for
`stdout`/`stderr`, it can't prevent code like
`sys.stdout.buffer.write()` or `subprocess.call(["cl.exe", ...])` to
bypass the encoder. This PR uses lossy UTF-8 conversion to avoid
decoding error.

## Alternative

Using `bstr` crate might be better since it can preserve original
information. Or we should follow the Windows convention, unset
`PYTHONIOENCODING` and decode with system default encoding.

## Test Plan

Running locally with non-ASCII character in `UV_CACHE_DIR` works fine,
but I have no unit test plan. Testing locale problem is hard :(
2024-10-11 09:10:06 -04:00
..
src Fix stream did not contain valid UTF-8 (#8120) 2024-10-11 09:10:06 -04:00
.gitignore Rename uv-build to uv-build-frontend (#7688) 2024-09-25 14:17:54 -04:00
Cargo.toml Improve legibility of build failure errors (#7854) 2024-10-03 12:52:53 +00:00