-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
…eam. NoMethodError You have a nil object when you didn't expect it! albino (1.2.3) lib/albino/process.rb:167:in block in read_and_write
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,16 +158,11 @@ def read_and_write(input, stdin, stdout, stderr, timeout=nil, max=nil) | |
# write to stdin stream | ||
ready[1].each do |fd| | ||
begin | ||
boom = nil | ||
size = fd.write_nonblock(input) | ||
input = input[size, input.size] | ||
rescue Errno::EPIPE => boom | ||
rescue Errno::EAGAIN, Errno::EINTR | ||
end | ||
if boom || input.size == 0 | ||
stdin.close | ||
writers.delete(stdin) | ||
fd.write(input) | ||
rescue Errno::EPIPE, Errno::EAGAIN, Errno::EINTR | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nono
|
||
end | ||
stdin.close | ||
writers.delete(stdin) | ||
end | ||
|
||
# read from stdout and stderr streams | ||
|
3 comments
on commit c115c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output string is encoded as "ascii", I have to use force_encoding("utf-8")
to make it works in my Rails app. I hope you see how to fix that ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mess with the output at all, did I? :/ This patch was just addressing stdin. Should that fix be a different patch/pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a regression between Albino 1.1.1 and 1.2.3, not from your patch.
For
Errno::EAGAIN
andErrno::EINTR
, I think you should not do the: