Bug #8541

Open3.popen3 creates a broken stdout pipe

Added by Mark Rada over 1 year ago. Updated over 1 year ago.

[ruby-core:55548]
Status:Rejected
Priority:Normal
Assignee:-
ruby -v:ruby 2.0.0p195 (2013-05-14 revision 40734) [universal.x86_64-darwin13] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

When I create a subprocess using Open3, the stdout pipe that is returned does allow reading.

Using the sample code provided, Ruby will block indefinitely waiting to read from the subprocess, though the subprocess has printed out to standard output.

If you change the test script to print/read from standard error instead, then everything works.

test.rb Magnifier (107 Bytes) Mark Rada, 06/19/2013 04:50 AM

History

#1 Updated by Mark Rada over 1 year ago

Note in the test script, the subprocess must continue running in order for the bug to manifest.

#2 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Open to Rejected

Use $stdout.flush after puts, or $stdout.sync = true before puts.

Also available in: Atom PDF