Skip to content

Test process::tests::test_inherit_env fails when environment variable contains non-ascii characters #40171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anta0 opened this issue Mar 1, 2017 · 2 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows

Comments

@anta0
Copy link

anta0 commented Mar 1, 2017

Result of ./x.py test src/libstd/:

failures:

---- process::tests::test_inherit_env stdout ----
        thread 'process::tests::test_inherit_env' panicked at 'called `Result::unwrap()` on an `Err` value: FromUtf8Error { bytes: [82, 85, 83, ... <snip> ... ], error: Utf8Error { valid_up_to: 2674 } }', src\libcore\result.rs:860

My environment variable contains "ChocolateyLastPathUpdate=水 12 14 19:40:40 2016" and which is the cause of this.

  • Rust version: current HEAD.
  • Host: x86_64-pc-windows-gnu

Note: Environment variables are OsStr but output encoding of cmd /c set depends on the environment (ShiftJIS on my computer).

@petrochenkov
Copy link
Contributor

petrochenkov commented Mar 1, 2017

Duplicate of #25268
The solution is to change the console code page to UTF-8 before running tests:

cmd /c "chcp 65001"

The old build system issued a warning for this specific case, but it was lost in rustbuild.

@steveklabnik steveklabnik added A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows labels Mar 1, 2017
@Mark-Simulacrum
Copy link
Member

I've been working on a rework of compiletest that fixes the underlying cause, but I'm going to close this since we do warn to change the code page as @petrochenkov notes above today I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

4 participants