Bug 10395 – [std.stdio] Closing a popened File with unread output throws an exception

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-06-17T15:29:58Z
Last change time
2017-12-18T22:55:15Z
Assigned to
alex.jercaianu
Creator
Martin Nowak

Comments

Comment #0 by code — 2013-06-17T15:29:58Z
cat > bug.d << CODE import std.stdio; void main(string[] args) { File file; file.popen("echo foobar"); file.close(); } CODE dmd -run bug ------ std.exception.ErrnoException@std/stdio.d(480): Command returned 13 (Success) ------ I don't know why pclose returns 13. NB: The error message is wrong too. It should be EINVAL (13) not Success (0).
Comment #1 by github-bugzilla — 2017-10-18T00:47:54Z
Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/04b0eee83661d3adeb1daf1f1cf5fc08d0533ffa Fix Issue 10395 - [std.stdio] Closing a popened File with unread output throws an exception
Comment #2 by github-bugzilla — 2017-12-18T22:55:15Z
Commit pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/04b0eee83661d3adeb1daf1f1cf5fc08d0533ffa Fix Issue 10395 - [std.stdio] Closing a popened File with unread output throws an exception