{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/2779","labels_url":"https://api.github.com/repos/jruby/jruby/issues/2779/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/2779/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/2779/events","html_url":"https://github.com/jruby/jruby/issues/2779","id":65160848,"number":2779,"title":"Encoding::UndefinedConversionError when IO.copy_streaming binary files","user":{"login":"janko-m","id":795488,"avatar_url":"https://avatars.githubusercontent.com/u/795488?v=3","gravatar_id":"","url":"https://api.github.com/users/janko-m","html_url":"https://github.com/janko-m","followers_url":"https://api.github.com/users/janko-m/followers","following_url":"https://api.github.com/users/janko-m/following{/other_user}","gists_url":"https://api.github.com/users/janko-m/gists{/gist_id}","starred_url":"https://api.github.com/users/janko-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janko-m/subscriptions","organizations_url":"https://api.github.com/users/janko-m/orgs","repos_url":"https://api.github.com/users/janko-m/repos","events_url":"https://api.github.com/users/janko-m/events{/privacy}","received_events_url":"https://api.github.com/users/janko-m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-30T08:31:26Z","updated_at":"2015-04-17T19:46:46Z","closed_at":null,"body":"We're trying to make [Refile](https://github.com/refile/refile) compatible with JRuby. We've almost made it (and it was fairly easy, I have to admit!), but we have one remaining bug.\r\n\r\nIn Refile we're using file wrappers, that is, we wrap an actual IO into a class which responds to `#read`, `#eof?`, `#close` and `#size`. This is all it takes to act as a real IO, because we can now pass them to `IO.copy_stream`, and it will work. However, when we wrap images (which are binary), `IO.copy_stream` raises an `Encoding::UndefinedConversionError`. The error doesn't happen if we pass the image IO directly, only when we use a wrapper (`ActionDispatch::Http::UploadedFile` or `Refile::File`, they both fail).\r\n\r\nWe weren't able to reproduce the problem (I posted an attempt of reproducing it), so we were hoping you could help us out. The pull request is https://github.com/refile/refile/pull/187. I think you only need to run `bundle install` to set up the test suite, the branch is `jruby` on my fork."},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/94060993","html_url":"https://github.com/jruby/jruby/issues/2779#issuecomment-94060993","issue_url":"https://api.github.com/repos/jruby/jruby/issues/2779","id":94060993,"user":{"login":"headius","id":10135,"avatar_url":"https://avatars.githubusercontent.com/u/10135?v=3","gravatar_id":"","url":"https://api.github.com/users/headius","html_url":"https://github.com/headius","followers_url":"https://api.github.com/users/headius/followers","following_url":"https://api.github.com/users/headius/following{/other_user}","gists_url":"https://api.github.com/users/headius/gists{/gist_id}","starred_url":"https://api.github.com/users/headius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headius/subscriptions","organizations_url":"https://api.github.com/users/headius/orgs","repos_url":"https://api.github.com/users/headius/repos","events_url":"https://api.github.com/users/headius/events{/privacy}","received_events_url":"https://api.github.com/users/headius/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T19:46:45Z","updated_at":"2015-04-17T19:46:45Z","body":"@janko-m Please try to reduce your case to a single executable script. I have not been able to get your branch to run tests on JRuby yet."}}