1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Read in ASCII-8BIT to get rid of invalid encoding error

This commit is contained in:
Nobuyoshi Nakada 2020-06-18 11:29:56 +09:00
parent 5755397064
commit cf1ee151b1
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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]