-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Windows stdio handles can be null #11
Comments
Yeah, this impacts termcolor too: BurntSushi/termcolor#53 When stdio handles are null on Windows, what does |
Nothing appears on screen but it's successful. And |
That's really weird. Also, I would have expected |
Yeah, it really did surprise me. I had to check I wasn't misunderstanding something. From a quick investigation it seems like stdio swallows So, yeah, the std APIs lie. |
Ok, I'm told this is very much intentional because otherwise, for example, |
Silent failures don't seem great. :-/ But yeah, not quite sure what to do here. |
Hm, I think this needs some serious design work. Obviously changing the standard library behaviour breaks programs so some new APIs might be required. I think I'd need to understand more about how this is being used in practice. One simple thing that could be done is for |
See also: rust-lang/rust#88576
In short, Windows stdio functions can return null to mean that there are no handles. The code here assumes stdio handles are always valid
File
handles. While this is technically an incorrect assumption, it worked out ok until Rust's new "Safe I/O" code was implemented.A workaround will be implemented upstream but I thought there should be an issue here too, since unfortunately it reached stable, causing
env_logger
to break.The text was updated successfully, but these errors were encountered: