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

win: FormatMessage failure when io failed #13075

Closed
klutzy opened this issue Mar 22, 2014 · 0 comments · Fixed by #13078
Closed

win: FormatMessage failure when io failed #13075

klutzy opened this issue Mar 22, 2014 · 0 comments · Fixed by #13078
Labels
O-windows Operating system: Windows

Comments

@klutzy
Copy link
Contributor

klutzy commented Mar 22, 2014

use std::io;

fn main() {
    let output = Path::new("badpath\\a.txt"); // badpath doesn't exist
    let _ret = io::File::create(&output); // so this is expected to return Err
}
task '<main>' failed at '[15100] FormatMessage failure', C:\home\stone\rust-vanilla\src\libstd\os.rs:743

Reproduced on rust revision 092afdb, windows 8.1 korean locale.

cc #13073

@huonw huonw added A-io and removed I-crash labels Mar 22, 2014
bors added a commit that referenced this issue Mar 22, 2014
`FormatMessageW()` is called by `std::os::last_os_error()` to convert
errno into string, but the function may fail on non-english locale.
I don't know why it fails, but anyway it's better to return errno
than to `fail!()` in the case.

Fixes #13075
Fixes #13073
@bors bors closed this as completed in cffe9e0 Mar 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants