We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23066ba commit 4e31480Copy full SHA for 4e31480
1 file changed
lib/rubygems/package.rb
@@ -552,6 +552,15 @@ def open_tar_gz(io) # :nodoc:
552
tar = Gem::Package::TarReader.new gzio
553
554
yield tar
555
+ ensure
556
+ # Consume remaining gzip data to prevent the
557
+ # "attempt to close unfinished zstream; reset forced" warning
558
+ # when the GzipReader is closed with unconsumed compressed data.
559
+ begin
560
+ IO.copy_stream(gzio, IO::NULL)
561
+ rescue Zlib::GzipFile::Error, IOError
562
+ nil
563
+ end
564
end
565
566
0 commit comments