Skip to content
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

Don't panic when printing JSON with non-utf8 paths #9226

Merged
merged 1 commit into from
Mar 2, 2021

Commits on Mar 2, 2021

  1. Don't panic when printing JSON with non-utf8 paths

    Before:
    
        λ cd \Xff/foo/ && cargo verify-project && cargo metadata
        {"success":"true"}
        warning: please specify `--format-version` flag explicitly to avoid compatibility problems
        thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("path contains invalid UTF-8 characters", line: 0, column: 0)', /rustc/a5a775e3f9e8043dad405e00aee0ae60882a7b71/src/tools/cargo/src/cargo/core/shell.rs:346:51
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    After:
    
        λ cd \Xff/foo/ && $cargo verify-project && $cargo metadata
        {"success":"true"}
        warning: please specify `--format-version` flag explicitly to avoid compatibility problems
        error: path contains invalid UTF-8 characters
    
    I am pretty  sure that this has zero real-world impact, but the diff is
    small, so why not handle it?
    matklad committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    dd5806d View commit details
    Browse the repository at this point in the history