[PATCH] Fix for writing tokenfile on python3
by Leif Gruenwoldt
The tokenfile must be opened in text mode to avoid an error on write:
TypeError: 'str' does not support the buffer interface
https://docs.python.org/3/library/configparser.html#configparser.ConfigPa...
Tested on Python 3.4.1.
---
bugzilla/base.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bugzilla/base.py b/bugzilla/base.py
index ca107b4..84d4be3 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -135,7 +135,7 @@ class _BugzillaToken(object):
self.tokenfile.set(self.domain, 'token', value)
if self.tokenfilename:
- with open(self.tokenfilename, 'wb') as tokenfile:
+ with open(self.tokenfilename, 'w') as tokenfile:
log.debug("Saving to tokenfile")
self.tokenfile.write(tokenfile)
--
1.9.0.msysgit.0
9 years, 11 months
[Patch] Fix ability to not save session cookies to disk
by Toshio Kuratomi
The switch to requests in python-bugzilla seems to have broken the ability
to use python-bugzilla without a persistent cookie store. The configuration
of requests in the code is telling requests not to use cookies at all when
what we want is just for requests to not save the cookies to a file on disk.
The attached patch should fix that.
-Toshio
9 years, 11 months
[PATCH] Fix for writing tokenfile on python3
by Leif Gruenwoldt
The tokenfile must be opened in text mode to avoid an error on write:
TypeError: 'str' does not support the buffer interface
https://docs.python.org/3/library/configparser.html#configparser.ConfigPa...
Tested with Python 3.4.1 on Windows.
---
bugzilla/base.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bugzilla/base.py b/bugzilla/base.py
index ca107b4..84d4be3 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -135,7 +135,7 @@ class _BugzillaToken(object):
self.tokenfile.set(self.domain, 'token', value)
if self.tokenfilename:
- with open(self.tokenfilename, 'wb') as tokenfile:
+ with open(self.tokenfilename, 'w') as tokenfile:
log.debug("Saving to tokenfile")
self.tokenfile.write(tokenfile)
--
1.9.0.msysgit.0
9 years, 11 months
extending command line actions for python-bugzilla
by Jindrich Luza
Hi
I have suggestion for extending command line actions provided by python-bugzilla cli.
Namely new_component and modify_component is what I'm talking about.
There's already API for modify component and new component in python-bugzilla, but
command line actions for use these features missing.
In attachment you can find little patch providing command lines actions mentioned above.
9 years, 11 months
Saved search with python-bugzilla
by Jan Hollevoet
I am trying to run a saved search with python-bugzilla 1.0.0 against a
Bugzilla 4.2.2 database. First I use url_to_query and pass the dict
({'sharer_id': '1', 'savedsearch': 'Open bugs'}) to the query method
of the BugzillaBase object. As a result I get
xmlrpclib.Fault: <Fault 53: 'savedsearch is not a valid parameter for
the Bugzilla::Bug::match function.'>
Any advice? Thanks in advance.
Jan
9 years, 11 months