I’m trying to use this expression. And It tell me that: storbinary() takes at most 4 arguments (5 given)
ftp.storbinary("STOR " + os.path.basename(name), StringIO(content_str), "rb", 8*1024)
I can see here only 4 argument. where is hidden 5th argument. I’m confuse.
You are calling a method, so the first argument is implicitly the object you’re calling the method on. In other words, you don’t see it, but it’s there.
Looking at the ftplib documentation, it seems that your third argument,
"rb", is incorrect. Your problem should be fixed if you simply remove that argument, as the third argument should be the blocksize.