Backport #5557
closedftp error uploading binary files
Description
I have a build script which uploads resulting zip files to a Dreamhost account using net/ftp. It used to work fine and no longer works. I have verified on a few machines that it appears to work fine on my Macs which have patch level 174 (Snow Leopard), but not on my Macs which have patch level 249 (both Snow Leopard and Lion). All Macs are on 1.8.7 so it appears that the patch level is where the break happened.
Here is a sample representing the kind of code that I have in my script (I have obviously taken out the actual domain, username, password, etc).
require 'net/ftp'
Net::FTP.open "ftp.mysite.com" do |ftp|
ftp.login "...", "..."
ftp.chdir "mybuilds"
ftp.putbinaryfile "myfile.zip"
end
Here is the stack trace I get:
Errno::EINVAL: Invalid argument
method write in ftp.rb at line 456
method storbinary in ftp.rb at line 456
method loop in ftp.rb at line 453
method storbinary in ftp.rb at line 453
method synchronize in monitor.rb at line 242
method storbinary in ftp.rb at line 450
method putbinaryfile in ftp.rb at line 562
method upload in build.rb at line 67
method build in build.rb at line 86
method run_builds in build.rb at line 127
method each in build.rb at line 102
method run_builds in build.rb at line 102
at top level in build.rb at line 168
method open in ftp.rb at line 115
at top level in build.rb at line 165