BadZipfile exception when nothing was put in the zip file
Status: Beta
Brought to you by:
whitemice
If the queueAction gets an empty zipfile it fails the route with a BadZipFile exception rather than just doing nothing. But why isn't the empty zip file just an empty zip file? instead it is an actually empty file.
Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/logic/workflow/services/process.py", line 825, in work action_name, description = self.run_stanza(action_uuid) File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/logic/workflow/services/process.py", line 398, in run_stanza parameters=stanza.get('params'), File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/core/context.py", line 566, in run_command command.run() File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/core/logic/action.py", line 294, in run self.do_action() File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/logic/workflow/actions/flow/queue.py", line 145, in do_action for handle, name, in self._yield_input_handles_and_name(): File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc89-py2.6.egg/coils/logic/workflow/actions/flow/queue.py", line 118, in _yield_input_handles_and_name zfile = zipfile.ZipFile(self.rfile, 'r', ) File "/usr/lib64/python2.6/zipfile.py", line 696, in __init__ self._GetContents() File "/usr/lib64/python2.6/zipfile.py", line 716, in _GetContents self._RealGetContents() File "/usr/lib64/python2.6/zipfile.py", line 728, in _RealGetContents raise BadZipfile, "File is not a zip file" BadZipfile: File is not a zip file
Can we somehow initialize the ZIP file so it is not just nothing? The origin of this this particular ZIP message as ftpGetFilesAction
Tried a HACK to ensure the ZIP archive was initialized if it was empty. That does not appear to have worked.
the attached test proves that this HACK should work
it appears that in production only four octets are actually in the output file; is this a failure to flush?
50 4B 05 06
Nope, the simple test fails on Python 2.6