Comment 2 for bug 713264

Revision history for this message
Gavin Panella (allenap) wrote : Re: bug-export.rnc does not ensure that attachments have contents

Ah, what I saw was the librarian client complaining, rather than the
librarian itself:

Traceback (most recent call last):
  File "/.../lib/lp/bugs/scripts/bugimport.py", line 274, in importBugs
    self.importBug(bugnode)
  File "/.../lib/lp/bugs/scripts/bugimport.py", line 328, in importBug
    self.createAttachments(bug, msg, commentnode)
  File "/.../lib/lp/bugs/scripts/bugimport.py", line 452, in createAttachments
    contentType=mimetype)
  File "/.../lib/canonical/launchpad/database/librarian.py", line 275, in create
    fid = client.addFile(name, size, file, contentType, expires, debugID)
  File "/.../lib/canonical/librarian/client.py", line 130, in addFile
    raise UploadFailed('Invalid length: %d' % size)
UploadFailed: Invalid length: 0

I see that this behaviour can be modified by passing
allow_zero_length=True to FileUploadClient.addFile().