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

Add binmode for Tempfile to prevent EOF (0x1A)

http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20151023T062322Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2015-10-27 07:34:18 +00:00
parent 6df21cb469
commit 3f682c2c8a

View file

@ -796,6 +796,7 @@ class FTPTest < Test::Unit::TestCase
assert_match(/\APASS /, commands.shift) assert_match(/\APASS /, commands.shift)
assert_equal("TYPE I\r\n", commands.shift) assert_equal("TYPE I\r\n", commands.shift)
Tempfile.create("foo", external_encoding: "ASCII-8BIT") do |f| Tempfile.create("foo", external_encoding: "ASCII-8BIT") do |f|
f.binmode
buf = String.new buf = String.new
res = ftp.getbinaryfile("foo", f.path) { |s| res = ftp.getbinaryfile("foo", f.path) { |s|
buf << s buf << s