Project

General

Profile

Actions

Bug #7239

closed

Can't read from subprocess when run with rubyw on windows

Added by mthiede (Martin Thiede) over 11 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
Backport:
[ruby-core:48542]

Description

File.open 'res.txt', 'w' do |f|
f << dir
end

when run with "rubyw", the file "res.txt" will be empty, when run with "ruby" it will contain the output of the "dir" command

the problem is present in Ruby versions 1.9.1, 1.9.2 and 1.9.3
the problem is not present in Ruby version 1.8.7


Related issues 1 (0 open1 closed)

Related to Backport193 - Backport #9232: Please Backport Bug #7239 to Ruby 1.9.3Closedusa (Usaku NAKAMURA)12/10/2013Actions

Updated by mthiede (Martin Thiede) over 11 years ago

I tested this with Windows 7

Updated by luislavena (Luis Lavena) over 11 years ago

  • Description updated (diff)
  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)
Actions #3

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37388.
Martin, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • process.c (redirect_dup2): set standard handles when new fd is stdio,
    because if there is no allocated console at the moment Windows does
    not automatically associate it for child process's standard handle.
    this is adhoc workaround.
    reported by Martin Thiede at [ruby-core:48542] [Bug #7239].

  • io.c (rb_cloexec_dup2): ditto.

Updated by ryanatball (Ryan Melton) over 10 years ago

Please backport this to Ruby 1.9.3.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0