<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><font size="3" face="Arial">Thanks for the information Cole,</font></div><div><font size="3" face="Arial"><br></font></div><div><font size="3" face="Arial">Installing pycurl was challenge ;-)</font></div><div><font size="3" face="Arial"><br></font></div><div><font size="3" face="Arial">However, I've installed python-request and latest python-bugzilla version from Git.&nbsp;</font></div><div><font size="3" face="Arial"><br></font></div><div><font size="3" face="Arial">But still I have problem while attaching the file. File get corrupted &nbsp;(that was my actual problem).</font></div><pre style="line-height: 21px; white-space: normal; color: rgb(68, 68, 68);"><font size="3" face="Arial"><br></font></pre><pre style="line-height: 21px; white-space: normal; color: rgb(68, 68, 68);"><font size="3" face="Arial">I am using "attachfile" method.</font></pre><pre><font color="#444444" size="3" face="Arial"><span style="line-height: 21px; white-space: normal;">&nbsp; &nbsp; def attachfile(self, idlist, attachfile, description, **kwargs):</span></font></pre><pre><font size="3" face="Arial"><font color="#444444"><span style="line-height: 21px; white-space: normal;">and &nbsp;</span></font><span style="color: rgb(68, 68, 68); line-height: 21px; white-space: normal;">&nbsp;_detect_filetype(fname) and "python&nbsp;</span><font color="#444444"><span style="line-height: 21px; white-space: normal;">magic"&nbsp;methods implemented in base.py but still file(s) (.zip, .jpeg etc) get corrupted after uploading on Bugzilla..&nbsp;</span></font></font></pre><div><font size="3" face="Arial"><br></font></div><pre style="line-height: 21px; white-space: normal; color: rgb(68, 68, 68); font-size: 15px;">//Mahboob</pre><pre style="line-height: 21px; white-space: normal; color: rgb(68, 68, 68); font-size: 15px;"><pre style="white-space: normal;"><br></pre></pre><br><div>&gt; Date: Thu, 14 Nov 2013 09:12:44 -0500<br>&gt; From: crobinso@redhat.com<br>&gt; To: khokhar_cth@live.com<br>&gt; CC: python-bugzilla@lists.fedorahosted.org<br>&gt; Subject: Re: [python-bugzilla] How to attach file ?<br>&gt; <br>&gt; On 11/14/2013 09:11 AM, Khokhar cth wrote:<br>&gt; &gt; Thanks Cole,<br>&gt; &gt; <br>&gt; &gt; I have start using "python-bugzilla *0.9.0*" (I assume this is latest one<br>&gt; &gt; ?)with python 2.7.<br>&gt; &gt; <br>&gt; &gt; This version using "pycurl" so i've installed curl and pycurl but still I have<br>&gt; &gt; problems.<br>&gt; &gt; <br>&gt; &gt; I've installed successfully "[curl-7.33.0-win64.msi][1]" and<br>&gt; &gt; "[pycurl-7.19.0.2.win-amd64-py2.7.exe][2]"<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; I got following Error:<br>&gt; &gt; <br>&gt; &gt;     import pycurl importError: DLL load failed: The specified procedure could<br>&gt; &gt; not be found<br>&gt; &gt;    <br>&gt; &gt;       File "C:\cc_stg\Git\bugzilla\cgi-bin\newbugs_lag.py", line 3, in &lt;module&gt;<br>&gt; &gt;         import create_bugzillas<br>&gt; &gt;       File "C:\cc_stg\Git\bugzilla\cgi-bin\create_bugzillas.py", line 2, in<br>&gt; &gt; &lt;module&gt;<br>&gt; &gt;         import bugzilla<br>&gt; &gt;       File "C:\cc_stg\Git\bugzilla\cgi-bin\bugzilla\__init__.py", line 21, in<br>&gt; &gt; &lt;module&gt;<br>&gt; &gt;         from bugzilla.base import BugzillaError<br>&gt; &gt;       File "C:\cc_stg\Git\bugzilla\cgi-bin\bugzilla\base.py", line 19, in &lt;module&gt;<br>&gt; &gt;         import pycurl<br>&gt; &gt;     ImportError: DLL load failed: The specified procedure could not be found.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; I have no idea how to fix this issue. Any help will be appreciated.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;   [1]: http://www.confusedbycode.com/curl/<br>&gt; &gt;   [2]: http://www.lfd.uci.edu/~gohlke/pythonlibs/<br>&gt; &gt; <br>&gt; &gt; Thanks in advance,<br>&gt; &gt; <br>&gt; &gt; //Mahboob<br>&gt; &gt; <br>&gt; <br>&gt; Ahh, didn't realize you are running on windows. I can't really help you there<br>&gt; unfortunately. However latest python-bugzilla in git actually switched away<br>&gt; from pycurl and to python-requests, which is a native python library, which<br>&gt; may be simpler to use on windows than pycurl.<br>&gt; <br>&gt; - Cole<br>&gt; <br>&gt; &gt; <br>&gt; &gt;  <br>&gt; &gt; <br>&gt; &gt;&gt; Date: Wed, 13 Nov 2013 10:14:25 -0500<br>&gt; &gt;&gt; From: crobinso@redhat.com<br>&gt; &gt;&gt; To: khokhar_cth@live.com<br>&gt; &gt;&gt; CC: python-bugzilla@lists.fedorahosted.org<br>&gt; &gt;&gt; Subject: Re: [python-bugzilla] How to attach file ?<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; On 11/13/2013 10:09 AM, Khokhar cth wrote:<br>&gt; &gt;&gt; &gt; Hi Cole,<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Thanks for the hint.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Now I am on next stage.File has been uploaded successfully but it got<br>&gt; &gt; corrupted.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; I got this problem while uploading file by using attachfile function of<br>&gt; &gt;&gt; &gt; python-bugzilla (inside base.py).<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; I am using python-bugzilla-0.8.0.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Here is my code:<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; downloaded_file = "abc.zip"<br>&gt; &gt;&gt; &gt; att_file_desc = "Attached file description"<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; kwards = {<br>&gt; &gt;&gt; &gt; 'contenttype':'application/octet-stream',<br>&gt; &gt;&gt; &gt; 'filename': downloaded_file<br>&gt; &gt;&gt; &gt; }<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; # attachfile method will return the id of attached file<br>&gt; &gt;&gt; &gt; bz.attachfile( bug_id, downloaded_file, att_file_desc, **kwards)<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Could you please guide me where I am doing mistake ?<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Thanks in advance,<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; //Mahboob<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; At the very least, please try with the latest python-bugzilla release, but<br>&gt; &gt;&gt; trying to reproduce with python-bugzilla git first is preferred.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; - Cole<br>&gt; <br></div>                                               </div></body>
</html>