-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO.select does not properly coerce timeout argument #821
Comments
If someone else wants to take this, go ahead. I'm probably not going to get to it tonight. |
FYI, I'm finding that this issue transcends more than just IO.select. Another example: require 'active_support/core_ext/numeric/time'
sleep 1 # Works
sleep 1.second # Fails with:
# TypeError: can't convert ActiveSupport::Durationinto time interval
# from org/jruby/RubyKernel.java:798:in `sleep'
# from (irb):3:in `evaluate'
# from org/jruby/RubyKernel.java:1093:in `eval'
# from org/jruby/RubyKernel.java:1489:in `loop'
# from org/jruby/RubyKernel.java:1254:in `catch'
# from org/jruby/RubyKernel.java:1254:in `catch'
# from /Users/sgeorge/.rvm/rubies/jruby-1.7.4/bin/irb:13:in `(root)' Versions |
Please file additional issues for cases where we do not coerce properly (and ideally make sure it's still broken on JRuby master). |
Got same problem with jruby 1.7.5 and ActiveSupport 4.0.0: [54] pry(main)> sleep 1.minute
TypeError: can't convert ActiveSupport::Durationinto time interval
from org/jruby/RubyKernel.java:826:in `sleep'
[55] pry(main)> 1.minute.class
=> Fixnum what additional data do you need to tackle this? |
The problem still shows on jruby 1.7.12 and ActiveSupport 4.1.0:
|
I've done some followup testing and the activesupport use-case is fixed at least in JRuby 1.7.21 but the original
|
* jruby-1_7: convert IO.select timeout argument to_f when its an unknown type (closing #821) convert Bignum timeout argument in `IO.select` as well remove unused private method in RubyIO + make method call in constructor final [build] fix typo in pom.rb for jruby-dist improve fix for dist build Fix dist build final name, which broke dist CI.
Given this code:
MRI 1.9.3 and 2.0.0 work fine, while JRuby (all modes) and MRI 1.8.7 raise "can't convert Foo into time interval (TypeError)". We are missing coercion logic.
The text was updated successfully, but these errors were encountered: