We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
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
finish
jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 OpenJDK 64-Bit Server VM 25.91-b14 on 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14 +jit [linux-x86_64]
Linux ubuntu 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
MRI Zlib::GzipWriter.wrap documentation says: "If you want to keep the associated IO object open, you may call #finish method in the block." (https://ruby-doc.org/stdlib-2.3.1/libdoc/zlib/rdoc/Zlib/GzipFile.html#method-c-wrap). Here is ruby MRI 2.3.1 example:
Zlib::GzipWriter.wrap
require 'zlib' out = StringIO.new Zlib::GzipWriter.wrap(out) { |gz| gz.finish } out.closed? # => false out.tap(&:rewind).read # => "\u001F\x8B\b\u0000ڸ\u0010X\u0000\u0003\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
I expected the same behavior with JRuby.
require 'zlib' out = StringIO.new Zlib::GzipWriter.wrap(out) { |gz| gz.finish } out.closed? # => true out.tap(&:rewind).read # raises IOError: not opened for reading
The text was updated successfully, but these errors were encountered:
Fix JRuby problem with closed stream
3bc55cd
It seems `Zlib::GzipWriter.wrap` behave differently with JRuby and ruby MRI. See jruby/jruby#4249.
No branches or pull requests
Environment
jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 OpenJDK 64-Bit Server VM 25.91-b14 on 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14 +jit [linux-x86_64]
Linux ubuntu 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Expected Behavior
MRI
Zlib::GzipWriter.wrap
documentation says: "If you want to keep the associated IO object open, you may call #finish method in the block." (https://ruby-doc.org/stdlib-2.3.1/libdoc/zlib/rdoc/Zlib/GzipFile.html#method-c-wrap). Here is ruby MRI 2.3.1 example:I expected the same behavior with JRuby.
Actual Behavior
The text was updated successfully, but these errors were encountered: