summaryrefslogtreecommitdiff
path: root/test/webrick/test_filehandler.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-18 11:29:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-18 11:36:21 +0900
commitcf1ee151b1cf7553fd0fce86a39eed4a4133ae46 (patch)
tree3b68615f2c360ef47b26a82eeaa40025ff58f097 /test/webrick/test_filehandler.rb
parent575539706496875ab36111d32f3d9ef2b9376854 (diff)
Read in ASCII-8BIT to get rid of invalid encoding error
Diffstat (limited to 'test/webrick/test_filehandler.rb')
-rw-r--r--test/webrick/test_filehandler.rb2
1 files changed, 1 insertions, 1 deletions
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]