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().
Ah, what I saw was the librarian client complaining, rather than the
librarian itself:
Traceback (most recent call last): lp/bugs/ scripts/ bugimport. py", line 274, in importBugs importBug( bugnode) lp/bugs/ scripts/ bugimport. py", line 328, in importBug createAttachmen ts(bug, msg, commentnode) lp/bugs/ scripts/ bugimport. py", line 452, in createAttachments =mimetype) canonical/ launchpad/ database/ librarian. py", line 275, in create addFile( name, size, file, contentType, expires, debugID) canonical/ librarian/ client. py", line 130, in addFile 'Invalid length: %d' % size)
File "/.../lib/
self.
File "/.../lib/
self.
File "/.../lib/
contentType
File "/.../lib/
fid = client.
File "/.../lib/
raise UploadFailed(
UploadFailed: Invalid length: 0
I see that this behaviour can be modified by passing length= True to FileUploadClien t.addFile( ).
allow_zero_