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
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'
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
Hi Cole, Thanks for the efficient reply. By using "python-bugzilla", I am developing a web page to make changing in bugzilla database. is it possible to utilize "command line tool" services in a webpage ? How I can reach 'bugzilla' command line tool that python-bugzilla ships ? is there any documentation for this tool ? Thanks in advance. # Khokhar
Date: Fri, 27 Sep 2013 09:13:42 -0400 From: crobinso@redhat.com To: python-bugzilla@lists.fedorahosted.org CC: khokhar_cth@live.com Subject: Re: [python-bugzilla] How to attach file ?
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
On 09/27/2013 11:00 AM, Khokhar cth wrote:
Hi Cole,
Thanks for the efficient reply.
By using "python-bugzilla", I am developing a web page to make changing in bugzilla database. is it possible to utilize "command line tool" services in a webpage ?
Maybe, but that wasn't my suggestion. I suggested to look at the command line code tool for an example of how to upload/download attachments.
How I can reach 'bugzilla' command line tool that python-bugzilla ships ? is there any documentation for this tool ?
Thanks in advance.
It's in the tarball under bin/bugzilla in pypi, not sure where it gets installed though since I'm using distribution packages for python-bugzilla.
- Cole
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
Date: Fri, 27 Sep 2013 11:05:11 -0400 From: crobinso@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@lists.fedorahosted.org Subject: Re: [python-bugzilla] How to attach file ?
On 09/27/2013 11:00 AM, Khokhar cth wrote:
Hi Cole,
Thanks for the efficient reply.
By using "python-bugzilla", I am developing a web page to make changing in bugzilla database. is it possible to utilize "command line tool" services in a webpage ?
Maybe, but that wasn't my suggestion. I suggested to look at the command line code tool for an example of how to upload/download attachments.
How I can reach 'bugzilla' command line tool that python-bugzilla ships ? is there any documentation for this tool ?
Thanks in advance.
It's in the tarball under bin/bugzilla in pypi, not sure where it gets installed though since I'm using distribution packages for python-bugzilla.
- Cole
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
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
Date: Wed, 13 Nov 2013 10:14:25 -0500 From: crobinso@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@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
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.
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@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@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
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@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@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.
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@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@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
On 11/19/2013 05:26 AM, Khokhar cth wrote:
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..
Does the bugzilla command line tool work for adding an attachment? What version is the bugzilla server? Is this server publicly accessible so I can try and reproduce on my side?
Can you reproduce with a patch like:
diff --git a/bugzilla/base.py b/bugzilla/base.py index 3a5d65d..5eae7c0 100644 --- a/bugzilla/base.py +++ b/bugzilla/base.py @@ -1226,6 +1226,7 @@ class BugzillaBase(object): ctype = 'application/octet-stream' kwargs['content_type'] = ctype
+ print kwargs ret = self._proxy.Bug.add_attachment(kwargs)
if "attachments" in ret:
So we can see exactly what arguments are being passed to the API call
- Cole
Hi Cole, Please see my reply in blue
Does the bugzilla command line tool work for adding an attachment?
I tried to use command line utility from latest Git but got 407 Client Error: Proxy Authentication Required
Date: 1 month ago
Commit hash: e1a094dfc8d734be89cb1626435f69118157a225
Here is trace back history of error.
Logging in... Traceback (most recent call last):
File "bugz", line 1173, in <module>
main()
File "bugz", line 1093, in main
if bz.login(global_opt.user, global_opt.password):
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 483, in login
r = self._login(self.user, self.password)
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 452, in _login
return self._proxy.User.login({'login': user, 'password': password})
File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1570, in __request
verbose=self.__verbose
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 190, in request
return self._request_helper(url, request_body)
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 167, in _request_helper
response.raise_for_status()
File "C:\Python27\lib\site-packages\requests\models.py", line 725, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 407 Client Error: Proxy Authentication Required
I already have set HTTP_proxy and https_proxy environment variables, so that's not the issue.
What version is the bugzilla server?
I am using bugzilla version 4.2.3 and version 4.2.4
Is this server publicly accessible so I can try and reproduce on my side?
No, it’s not accessible publically. I've attached "lib.py" file from where I am using attachfile methods as patch from latest version of python-bugzilla. Here you can see the arguments and how I call this function.
kwards = { 'filename': file_name } lib.attachfile(bz_server, bug_id, attach_file, file_name, **kwards)
Now I’ve two problems:
1. How to get rid of Proxy Authentication problem?
2. How can I successfully attach file so it shall not get corrupted after uploading on Bugzilla? And Thanks for your detailed reply and inquiry about the problem and Thanks in advance as well. //Khokhar
Date: Tue, 19 Nov 2013 13:12:41 -0500 From: crobinso@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@lists.fedorahosted.org Subject: Re: [python-bugzilla] How to attach file ?
On 11/19/2013 05:26 AM, Khokhar cth wrote:
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..
Does the bugzilla command line tool work for adding an attachment? What version is the bugzilla server? Is this server publicly accessible so I can try and reproduce on my side?
Can you reproduce with a patch like:
diff --git a/bugzilla/base.py b/bugzilla/base.py index 3a5d65d..5eae7c0 100644 --- a/bugzilla/base.py +++ b/bugzilla/base.py @@ -1226,6 +1226,7 @@ class BugzillaBase(object): ctype = 'application/octet-stream' kwargs['content_type'] = ctype
print kwargs ret = self._proxy.Bug.add_attachment(kwargs) if "attachments" in ret:
So we can see exactly what arguments are being passed to the API call
- Cole
Hi Cole, I think I've figured out the reason why attached file being corrupted.To upload the file we need to pass Base64 encoded data.Data has to encode as Base64 and data must be declared as Base64 encoded as well. Else it's passed as a string and is not decoded by Bugzilla.I presume the following code of "attachfile" method needs to be modify in base.py data = f.read() if not isinstance(data, bytes): data = data.encode(locale.getpreferredencoding()) kwargs['data'] = Binary(data) I've tried like this but unfortunately it doesn't work. # data = f.read() # encoded_data = base64.b64encode(data)# kwargs['data'] = encoded_data Reference Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=958559 Any Suggestion? From: khokhar_cth@live.com To: crobinso@redhat.com Date: Thu, 19 Dec 2013 16:58:32 +0100 CC: python-bugzilla@lists.fedorahosted.org Subject: Re: [python-bugzilla] How to attach file ?
Hi Cole, Please see my reply in blue
Does the bugzilla command line tool work for adding an attachment?
I tried to use command line utility from latest Git but got 407 Client Error: Proxy Authentication Required
Date: 1 month ago
Commit hash: e1a094dfc8d734be89cb1626435f69118157a225
Here is trace back history of error.
Logging in... Traceback (most recent call last):
File "bugz", line 1173, in <module>
main()
File "bugz", line 1093, in main
if bz.login(global_opt.user, global_opt.password):
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 483, in login
r = self._login(self.user, self.password)
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 452, in _login
return self._proxy.User.login({'login': user, 'password': password})
File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1570, in __request
verbose=self.__verbose
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 190, in request
return self._request_helper(url, request_body)
File "C:\cc_stg\Git\python-bugzilla\cgi-bin\bugzilla\base.py", line 167, in _request_helper
response.raise_for_status()
File "C:\Python27\lib\site-packages\requests\models.py", line 725, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 407 Client Error: Proxy Authentication Required
I already have set HTTP_proxy and https_proxy environment variables, so that's not the issue.
What version is the bugzilla server?
I am using bugzilla version 4.2.3 and version 4.2.4
Is this server publicly accessible so I can try and reproduce on my side?
No, it’s not accessible publically. I've attached "lib.py" file from where I am using attachfile methods as patch from latest version of python-bugzilla. Here you can see the arguments and how I call this function.
kwards = { 'filename': file_name } lib.attachfile(bz_server, bug_id, attach_file, file_name, **kwards)
Now I’ve two problems:
1. How to get rid of Proxy Authentication problem?
2. How can I successfully attach file so it shall not get corrupted after uploading on Bugzilla? And Thanks for your detailed reply and inquiry about the problem and Thanks in advance as well. //Khokhar
Date: Tue, 19 Nov 2013 13:12:41 -0500 From: crobinso@redhat.com To: khokhar_cth@live.com CC: python-bugzilla@lists.fedorahosted.org Subject: Re: [python-bugzilla] How to attach file ?
On 11/19/2013 05:26 AM, Khokhar cth wrote:
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..
Does the bugzilla command line tool work for adding an attachment? What version is the bugzilla server? Is this server publicly accessible so I can try and reproduce on my side?
Can you reproduce with a patch like:
diff --git a/bugzilla/base.py b/bugzilla/base.py index 3a5d65d..5eae7c0 100644 --- a/bugzilla/base.py +++ b/bugzilla/base.py @@ -1226,6 +1226,7 @@ class BugzillaBase(object): ctype = 'application/octet-stream' kwargs['content_type'] = ctype
print kwargs ret = self._proxy.Bug.add_attachment(kwargs) if "attachments" in ret:
So we can see exactly what arguments are being passed to the API call
- Cole
_______________________________________________ python-bugzilla mailing list python-bugzilla@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/python-bugzilla
On 01/17/2014 04:54 AM, Khokhar cth wrote:
Hi Cole,
I think I've figured out the reason why attached file being corrupted. To upload the file we need to pass Base64 encoded data. Data has to encode as Base64 and data must be declared as Base64 encoded as well. Else it's passed as a string and is not decoded by Bugzilla. I presume the following code of "attachfile" method needs to be modify in base.py
data = f.read() if not isinstance(data, bytes): data = data.encode(locale.getpreferredencoding()) kwargs['data'] = Binary(data)
I've tried like this but unfortunately it doesn't work.
# data = f.read() # encoded_data = base64.b64encode(data) # kwargs['data'] = encoded_data
Reference Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=958559
Any Suggestion?
If I add this patch to git:
diff --git a/bugzilla/base.py b/bugzilla/base.py index bb7b940..0a6213b 100644 --- a/bugzilla/base.py +++ b/bugzilla/base.py @@ -34,6 +34,9 @@ import requests from bugzilla import __version__, log from bugzilla.bug import _Bug, _User
+import httplib +httplib.HTTPConnection.debuglevel = 1 +
# Backwards compatibility Bug = _Bug
Then run an attach command like:
PYTHONPATH=. ./bugzilla-cli --debug --bugzilla partner-bugzilla.redhat.com attach --file ~/py.png 946419
I see this result:
send: "POST /xmlrpc.cgi HTTP/1.1\r\nHost: partner-bugzilla.redhat.com\r\nContent-Length: 1557\r\nAccept-Encoding: gzip, deflate, compress\r\nAccept: */*\r\nUser-Agent: Python/Bugzilla\r\nCookie: Bugzilla_logincookie=Jzkuaso0fH; Bugzilla_login=199727\r\nContent-Type: text/xml\r\n\r\n<?xml version='1.0'?>\n<methodCall>\n<methodName>Bug.add_attachment</methodName>\n<params>\n<param>\n<value><struct>\n<member>\n<name>file_name</name>\n<value><string>py.png</string></value>\n</member>\n<member>\n<name>data</name>\n<value><base64>\niVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A\n/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9gEGxE4IQYzJ14AAAI3SURBVDjL\nZZNPSFVBFIe/e9+zd3silBCl0SZoU4s2rVq0EB5tQip4UNvATVGu3QRBiyAi2iltWkgbF5EgRhFF\nRpiWtrWIzDIV1Pzz7p15M2fmtvDevOqBw8DM9zvnN8ycgF3R/eDtM2mac96ZdrFNxBikqbRV+vHH\n/ut9gAZczoe7C3gnF0f6au1OLM5avFi8d1Ea+JvAMSAq8nsKOGs5f2cYJ3Y7rc2PO4BqkS8DdD98\nf9tbe1ysCoxOBo1qlEXHJWcM4b5KPU19zleA0o4Clx99eO3EdqVewHsCoFRugUoVghJO7A6H6Vx9\nwdtYi27cr5x6dy/03nVtWTU7bWeZh6jNUcAiCaFTURl9A+gs56AviHzh3mnqtdPxm6knfQPLU7Ua\nokASQq/agY7yDrG16Mba6Pz48NP56VdrgAApYObGaicPtkovToFLQBKA/WUxTe3FRk4san15aGKg\nd3Dj560rrdGJS6FT0X9YYvLuiMKL1kAQOpHZ3PqfyZfP41+9PW1VfzX0RXFSECfgNEmSTgImdDru\nF2O0E8vvqZG1auQubAsKooIYYHpGvwA2g+xndQBHgWa6! cG0ih5cW/w 6VvEq3nChwCoBvs+bL2Z7V\nceBHGTDAIrABpMVuhw+4OiLgLIglOLPYBTQAlfErIeCzjRVg1dtEb1kt5Omv+DTV2YssAN+zNdkz\nC42N9brV8WdvYp07seOdM2Of1F3AAknW0AJpwN6IgEPAEaANaMlcbmZdl7KRBuAfAb+v//yMAJoA\nAAAASUVORK5CYII=\n</base64></value>\n</member>\n<member>\n<name>ids</name>\n<value><array><data>\n<value><string>946419</string></value>\n</data></array></value>\n</member>\n<member>\n<name>content_type</name>\n<value><string>application/octet-stream</string></value>\n</member>\n<member>\n<name>summary</name>\n<value><string>py.png</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n" reply: 'HTTP/1.1 200 OK\r\n' header: Date: Fri, 17 Jan 2014 15:04:14 GMT header: Server: Apache header: SOAPServer: SOAP::Lite/Perl/0.710.06 header: X-Content-Type-Options: nosniff header: X-Frame-Options: SAMEORIGIN header: X-Xss-Protection: 1; mode=block header: Vary: Accept-Encoding,User-Agent header: Content-Encoding: gzip header: Content-Length: 164 header: Content-Type: text/xml header: Connection: close Created attachment 728575 on bug 946419
In the 'send' bit, you can see that the data is declared as <base64>, so it seems like we are doing the correct thing here.
What does that change give you?
- Cole
python-bugzilla@lists.stg.fedorahosted.org