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.ConfigParse...
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)
On 05/26/2014 03:45 PM, Leif Gruenwoldt wrote:
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.ConfigParse...
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)
ACK and pushed.
Thanks, Cole
python-bugzilla@lists.stg.fedorahosted.org