Submission of files through requests.POST depletes the file pointer. Need to rewind for replay

This commit is contained in:
kimth
2012-08-19 20:38:10 -04:00
parent 2f63a9b403
commit 891797a3bb

View File

@@ -83,6 +83,9 @@ class XQueueInterface(object):
if error and (msg == 'login_required'): # Log in, then try again
self._login()
if files_to_upload is not None:
for f in files_to_upload: # Need to rewind file pointers
f.seek(0)
(error, msg) = self._send_to_queue(header, body, files_to_upload)
return (error, msg)