From b9dd026f290269fd8ef70d2e67e186e9ae820fd6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 5 Oct 2026 22:37:31 +0900 Subject: [PATCH] Open gzip in binary mode It is binary format, read in text mode stops at 0x1a (^Z). --- test/json/json_common_interface_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/json/json_common_interface_test.rb b/test/json/json_common_interface_test.rb index 0fbc2df7..cf11c8f0 100644 --- a/test/json/json_common_interface_test.rb +++ b/test/json/json_common_interface_test.rb @@ -135,7 +135,7 @@ def test_load stringio.rewind assert_equal @hash, JSON.load(stringio) - tempfile = Tempfile.open('@json.gzip') + tempfile = Tempfile.open('@json.gzip', mode: File::BINARY) gzw = Zlib::GzipWriter.new(tempfile) gzw.write(@json) gzw.close