[python-bugzilla] How to attach file ?

Khokhar cth khokhar_cth at live.com
Tue Nov 19 10:26:38 UTC 2013


Thanks for the information Cole,
Installing pycurl was challenge ;-)
However, I've installed python-request and latest python-bugzilla version from Git. 
But still I have problem while attaching the file. File get corrupted  (that was my actual problem).
I am using "attachfile" method.    def attachfile(self, idlist, attachfile, description, **kwargs):and   _detect_filetype(fname) and "python magic" methods implemented in base.py but still file(s) (.zip, .jpeg etc) get corrupted after uploading on Bugzilla.. 
//Mahboob

> Date: Thu, 14 Nov 2013 09:12:44 -0500
> From: crobinso at redhat.com
> To: khokhar_cth at live.com
> CC: python-bugzilla at lists.fedorahosted.org
> Subject: Re: [python-bugzilla] How to attach file ?
> 
> On 11/14/2013 09:11 AM, Khokhar cth wrote:
> > Thanks Cole,
> > 
> > I have start using "python-bugzilla *0.9.0*" (I assume this is latest one
> > ?)with python 2.7.
> > 
> > This version using "pycurl" so i've installed curl and pycurl but still I have
> > problems.
> > 
> > I've installed successfully "[curl-7.33.0-win64.msi][1]" and
> > "[pycurl-7.19.0.2.win-amd64-py2.7.exe][2]"
> > 
> > 
> > I got following Error:
> > 
> >     import pycurl importError: DLL load failed: The specified procedure could
> > not be found
> >    
> >       File "C:\cc_stg\Git\bugzilla\cgi-bin\newbugs_lag.py", line 3, in <module>
> >         import create_bugzillas
> >       File "C:\cc_stg\Git\bugzilla\cgi-bin\create_bugzillas.py", line 2, in
> > <module>
> >         import bugzilla
> >       File "C:\cc_stg\Git\bugzilla\cgi-bin\bugzilla\__init__.py", line 21, in
> > <module>
> >         from bugzilla.base import BugzillaError
> >       File "C:\cc_stg\Git\bugzilla\cgi-bin\bugzilla\base.py", line 19, in <module>
> >         import pycurl
> >     ImportError: DLL load failed: The specified procedure could not be found.
> > 
> > 
> > 
> > I have no idea how to fix this issue. Any help will be appreciated.
> > 
> > 
> >   [1]: http://www.confusedbycode.com/curl/
> >   [2]: http://www.lfd.uci.edu/~gohlke/pythonlibs/
> > 
> > Thanks in advance,
> > 
> > //Mahboob
> > 
> 
> Ahh, didn't realize you are running on windows. I can't really help you there
> unfortunately. However latest python-bugzilla in git actually switched away
> from pycurl and to python-requests, which is a native python library, which
> may be simpler to use on windows than pycurl.
> 
> - Cole
> 
> > 
> >  
> > 
> >> Date: Wed, 13 Nov 2013 10:14:25 -0500
> >> From: crobinso at redhat.com
> >> To: khokhar_cth at live.com
> >> CC: python-bugzilla at lists.fedorahosted.org
> >> Subject: Re: [python-bugzilla] How to attach file ?
> >>
> >> On 11/13/2013 10:09 AM, Khokhar cth wrote:
> >> > Hi Cole,
> >> >
> >> > Thanks for the hint.
> >> >
> >> > Now I am on next stage.File has been uploaded successfully but it got
> > corrupted.
> >> >
> >> > I got this problem while uploading file by using attachfile function of
> >> > python-bugzilla (inside base.py).
> >> >
> >> > I am using python-bugzilla-0.8.0.
> >> >
> >> > Here is my code:
> >> >
> >> > downloaded_file = "abc.zip"
> >> > att_file_desc = "Attached file description"
> >> >
> >> > kwards = {
> >> > 'contenttype':'application/octet-stream',
> >> > 'filename': downloaded_file
> >> > }
> >> >
> >> > # attachfile method will return the id of attached file
> >> > bz.attachfile( bug_id, downloaded_file, att_file_desc, **kwards)
> >> >
> >> >
> >> > Could you please guide me where I am doing mistake ?
> >> >
> >> > Thanks in advance,
> >> >
> >> >
> >> > //Mahboob
> >>
> >> At the very least, please try with the latest python-bugzilla release, but
> >> trying to reproduce with python-bugzilla git first is preferred.
> >>
> >> - Cole
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/python-bugzilla/attachments/20131119/21c43abe/attachment.html>


More information about the python-bugzilla mailing list