Sorry, I meant to add that, if I revert io.c to how it is in git, my one-liner says: ``` martind@stormy:~/download/ruby$ ./ruby --disable-gems -we 'IO.popen("-") { |io| raise("a fuss") unless io; }; puts($?.inspect())' #<Process::Stat...martin.dorey@hds.com (Martin Dorey)
Domo arigato, Nobu-san, for agreeing that the previous behavior wasn't right and for such a quick fix. I really like the idea of expressing how the code should behave with a unit test. I was surprised by a couple of aspects of your tes...martin.dorey@hds.com (Martin Dorey)
I was surprised by the "ensure" being reached in the child process here: ``` ruby martind@stormy:~/tmp/D161730$ cat repro.rb #!/usr/bin/ruby -w parent = Process.pid() [false, true].each() { |nauseous| $stderr.puts("#{naus...martin.dorey@hds.com (Martin Dorey)
The block form of `IO.popen` waits for the child process to finish before quitting. If the parent process exits during this wait, the wait is interrupted and the exit proceeds promptly. There's a difference in behavior, however, if the...martin.dorey@hds.com (Martin Dorey)