From cf1ee151b1cf7553fd0fce86a39eed4a4133ae46 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 18 Jun 2020 11:29:56 +0900 Subject: Read in ASCII-8BIT to get rid of invalid encoding error --- test/webrick/test_filehandler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/webrick/test_filehandler.rb') diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 992850c1c2..ff75f07c53 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -260,7 +260,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase http = Net::HTTP.new(addr, port) if windows? root = config[:DocumentRoot].tr("/", "\\") - fname = IO.popen(%W[dir /x #{root}\\webrick_long_filename.cgi], &:read) + fname = IO.popen(%W[dir /x #{root}\\webrick_long_filename.cgi], encoding: "binary", &:read) fname.sub!(/\A.*$^$.*$^$/m, '') if fname fname = fname[/\s(w.+?cgi)\s/i, 1] -- cgit v1.2.3