From 891797a3bb7e58df27c27dda1ceb82420711a57a Mon Sep 17 00:00:00 2001 From: kimth Date: Sun, 19 Aug 2012 20:38:10 -0400 Subject: [PATCH] Submission of files through requests.POST depletes the file pointer. Need to rewind for replay --- common/lib/capa/capa/xqueue_interface.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/lib/capa/capa/xqueue_interface.py b/common/lib/capa/capa/xqueue_interface.py index 10f36636b8..2930eb682d 100644 --- a/common/lib/capa/capa/xqueue_interface.py +++ b/common/lib/capa/capa/xqueue_interface.py @@ -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)