-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
active_support/json doesn't handle IO objects correctly #26132
Comments
@liudangyi I am not sure but may it has something to do with this |
@veekram Yes, I understand why it happened. But I think it's still a bug of activesupport, since |
Introducing activesupport will break env.to_json, so use JSON.generate instead. See rails/rails#26132
Where are you getting that idea from? |
I was trying to serialize So introducing "active_support" just breaks the existing code, right? |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
This can still be reproduced on master. Adding this to
|
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
Fix #to_json for IO objects, fixes #26132
You should fix this also for rails 5.0 |
There is some incompatibility generating the following error when you use the gems JSON and ActiveSupport: IOError (not opened for reading). This change fixes it.
I just observed this in |
Steps to reproduce
Expected behavior
to_json
should never fail.Actual behavior
It raises an error because
STDOUT.to_a
fails.System configuration
Rails version: master (5.1.0.alpha)
Ruby version: 2.3.1p112
The text was updated successfully, but these errors were encountered: