[python-bugzilla] How to attach file ?

Cole Robinson crobinso at redhat.com
Fri Sep 27 13:13:42 UTC 2013


On 09/27/2013 08:47 AM, Khokhar cth wrote:
> Hello everybody,
> 
> I am working on bugzilla xml-rpc by using "Bugzilla XMLRPC access
> module"  https://pypi.python.org/pypi/python-bugzilla
> 
> 
> How I can attach/download file of bugzilla ?  
> 
> According to guideline (link given
> below) get_attachments_by_bug($bug_id) retrieves and returns the attachments.  
> 
> http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/Attachment.html  
> <http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/Attachment.html >
> 
> But this function didn't worked for me, I got following error message.
> 
> *<type 'exceptions.AttributeError'>*: 'Bugzilla4' object has no attribute
> 'get_attachments_by_bug' 

Not all bugzilla XMLRPC APIs are wrapped by python-bugzilla, that's one of them.

The 'bugzilla' command line tool that python-bugzilla ships has commands for
attaching files and downloading attachments, take a look at the code there for
guidance.

- Cole



More information about the python-bugzilla mailing list