curl-and-python
Re: help with pycurl/win32 and HTTP PUT
Date: Wed, 9 Feb 2005 22:57:15 +0100 (CET)
On Wed, 9 Feb 2005, jason kratz wrote:
(this is not an actual libcurl issue, this is a using-pycurl issue - thus
CC'ing the libcurl mailing list won't add much good)
> def read_callback(self, size):
> line = self.f.read(size)
> return line
Is this code running on windows? Have you made sure you opened the file in
binary mode if it contains binary data?
If you compare the data that is uploaded to the file you wanted to upload,
what data is missing in the uploaded file? (2976 bytes were missing)
You can also use curl's --trace-ascii option and pycurl's DEBUGFUNCTION option
to get to see exactly what data that is sent "over the wire" and comparing
those two should offer some new clues.
(In libcurl land, the callback must return the size of the data it read, but I
guess that is magic pycurl takes care of for you behind your back.)
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.html _______________________________________________ http://cool.haxx.se/mailman/listinfo/curl-and-pythonReceived on 2005-02-09