By Sean Reifschneider Date 2011-08-12 00:56 Tags curl, error, python, sean reifschneider
The error: "pycurl.error: (26, 'failed creating formpost data')" was a bit tricky to look up, but I was able to find a report on the curl mailing list that this error indicates that the file up are trying to upload via a form upload does not exist.
Sure enough, when I checked the value I was passing as the name of the file to upload, I was using the wrong name -- a name that didn't exist. So if you run into this error, verify that the filename you are passing does exist.
If this answer helped you, please post a link to this page so that it shows up high in the results. I had to do a lot of digging to get the answer.
In general I've been pretty happy with pycurl. I had thought urllib would let me upload a file, but it required a lot of extra code to do. pycurl isn't that well documented, but I was able to find examples that helped me get it done, and I've been happy with curl from the command-line, so I figured I'd try it. Other than having to build pycurl on one CentOS 4 box, and this information-free error message, it's worked quite well.
comments powered by Disqus