{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/15890","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/15890/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/15890/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/15890/events","html_url":"https://github.com/rust-lang/rust/issues/15890","id":38364141,"number":15890,"title":"Cannot compile a file in a non-utf8 directory","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-driver","name":"A-driver","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-07-22T02:37:09Z","updated_at":"2016-02-28T03:03:12Z","closed_at":null,"body":"```\r\n$ mkdir $(echo 'foo\\xff') \r\n$ touch $(echo 'foo\\xff')/foo.rs\r\n$ rustc $(echo 'foo\\xff')/foo.rs\r\nerror: couldn't read foo�/foo.rs: couldn't open file (no such file or directory (No such file or directory); path=foo�/foo.rs; mode=open; access=read)\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/189771030","html_url":"https://github.com/rust-lang/rust/issues/15890#issuecomment-189771030","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/15890","id":189771030,"user":{"login":"cuviper","id":36186,"avatar_url":"https://avatars.githubusercontent.com/u/36186?v=3","gravatar_id":"","url":"https://api.github.com/users/cuviper","html_url":"https://github.com/cuviper","followers_url":"https://api.github.com/users/cuviper/followers","following_url":"https://api.github.com/users/cuviper/following{/other_user}","gists_url":"https://api.github.com/users/cuviper/gists{/gist_id}","starred_url":"https://api.github.com/users/cuviper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuviper/subscriptions","organizations_url":"https://api.github.com/users/cuviper/orgs","repos_url":"https://api.github.com/users/cuviper/repos","events_url":"https://api.github.com/users/cuviper/events{/privacy}","received_events_url":"https://api.github.com/users/cuviper/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T03:03:12Z","updated_at":"2016-02-28T03:03:12Z","body":"It now fails saying, \"called `Result::unwrap()` on an `Err` value\".  I believe this is simply due to `rustc_driver::main()` using `env::args()` rather than `env::args_os()`, so it panics on the non-utf8.  You can reproduce this with any bad argument at all, e.g. in bash:\r\n\r\n```\r\n$ rustc $'\\xff'\r\nthread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: \"\\u{fffd}\"', ../src/libcore/result.rs:746\r\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\r\n```\r\n\r\nAccepting `OsString` will require changes down through the `getopts` crate, and I guess all the other users of that should be updated too.  I'm interested to try, if this sounds ok..."}}