python-bugzilla is failing for me since I updated to F22. Is anybody else hitting this? Everything fails with "data must be a byte string". I nuked ~/.bugzilla*. e.g.:
$ bugzilla --debug login jorton foo [10:22:14] INFO (bugzilla:1160) Connecting to https://bugzilla.redhat.com/xmlrpc.cgi [10:22:14] INFO (bugzilla:1163) Autodetecting Bugzilla type [10:22:14] DEBUG (__init__:39) Detecting subclass for https://bugzilla.redhat.com/xmlrpc.cgi [10:22:14] INFO (__init__:46) Using RHBugzilla for URL containing bugzilla.redhat.com [10:22:14] INFO (__init__:114) Chose subclass RHBugzilla v0.1 [10:22:14] DEBUG (base:420) Using tokenfile=/home/jorton/.bugzillatoken [10:22:14] DEBUG (base:537) Using cookiefile=/home/jorton/.bugzillacookies [10:22:14] INFO (base:676) Using username/password for authentication [10:22:14] INFO (base:684) Logging in... data must be a byte string $ rpm -qf /usr/bin/bugzilla python-bugzilla-1.2.1-1.fc22.noarch
Any help appreciated!
Regards, Joe
На 10.07.2015 в 12:24, Joe Orton написа:
python-bugzilla is failing for me since I updated to F22. Is anybody else hitting this? Everything fails with "data must be a byte string". I nuked ~/.bugzilla*. e.g.:
$ bugzilla --debug login jorton foo [10:22:14] INFO (bugzilla:1160) Connecting to https://bugzilla.redhat.com/xmlrpc.cgi [10:22:14] INFO (bugzilla:1163) Autodetecting Bugzilla type [10:22:14] DEBUG (__init__:39) Detecting subclass for https://bugzilla.redhat.com/xmlrpc.cgi [10:22:14] INFO (__init__:46) Using RHBugzilla for URL containing bugzilla.redhat.com [10:22:14] INFO (__init__:114) Chose subclass RHBugzilla v0.1 [10:22:14] DEBUG (base:420) Using tokenfile=/home/jorton/.bugzillatoken [10:22:14] DEBUG (base:537) Using cookiefile=/home/jorton/.bugzillacookies [10:22:14] INFO (base:676) Using username/password for authentication [10:22:14] INFO (base:684) Logging in... data must be a byte string $ rpm -qf /usr/bin/bugzilla python-bugzilla-1.2.1-1.fc22.noarch
Any help appreciated!
Hi Joe, check out this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1241561
maybe it is something similar ?
-- Alex
On Mon, Jul 13, 2015 at 10:26:36AM +0300, Alexander Todorov wrote: ...
data must be a byte string $ rpm -qf /usr/bin/bugzilla python-bugzilla-1.2.1-1.fc22.noarch
Any help appreciated!
Hi Joe, check out this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1241561
It's not that. I'm confused though - is everybody else using python-bugzilla successfully on Fedora 22, or has nobody else tried it?
I tracked down the error, anyway.
The exception originates from pyOpenSSL's Connection.send(), which has:
if not isinstance(buf, bytes): raise TypeError("data must be a byte string")
The reason is that the passed-in buffer is a unicode object rather than a byte string.
python-bugzilla's RequestsTransport.request() does this, which I don't understand:
# Needed for python-requests < 2.0 with python3, otherwise we get # Content-Type error later for the POST request request_body = request_body.decode('utf-8')
Is the problem that some versions of python-requests want a unicode object and some want a UTF-8-encoded string (str object)? Flipping the decode to an encode fixes the problem for me, ensuring request_body is a str object not a unicode object. For reference, package versions:
python-requests-2.7.0-1.fc22.noarch python-bugzilla-1.2.1-1.fc22.noarch pyOpenSSL-0.14-3.fc22.noarch
Regards, Joe
On 07/22/2015 04:59 AM, Joe Orton wrote:
On Mon, Jul 13, 2015 at 10:26:36AM +0300, Alexander Todorov wrote: ...
data must be a byte string $ rpm -qf /usr/bin/bugzilla python-bugzilla-1.2.1-1.fc22.noarch
Any help appreciated!
Hi Joe, check out this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1241561
It's not that. I'm confused though - is everybody else using python-bugzilla successfully on Fedora 22, or has nobody else tried it?
I tracked down the error, anyway.
The exception originates from pyOpenSSL's Connection.send(), which has:
if not isinstance(buf, bytes): raise TypeError("data must be a byte string")
The reason is that the passed-in buffer is a unicode object rather than a byte string.
python-bugzilla's RequestsTransport.request() does this, which I don't understand:
# Needed for python-requests < 2.0 with python3, otherwise we get # Content-Type error later for the POST request request_body = request_body.decode('utf-8')
Is the problem that some versions of python-requests want a unicode object and some want a UTF-8-encoded string (str object)? Flipping the decode to an encode fixes the problem for me, ensuring request_body is a str object not a unicode object. For reference, package versions:
python-requests-2.7.0-1.fc22.noarch python-bugzilla-1.2.1-1.fc22.noarch pyOpenSSL-0.14-3.fc22.noarch
$ rpm -q python-requests python-bugzilla pyOpenSSL python-requests-2.7.0-1.fc22.noarch python-bugzilla-1.2.1-1.fc22.noarch pyOpenSSL-0.14-3.fc22.noarch
$ bugzilla --debug login jorton foo [10:52:25] INFO (bugzilla:1160) Connecting to https://bugzilla.redhat.com/xmlrpc.cgi [10:52:25] INFO (bugzilla:1163) Autodetecting Bugzilla type [10:52:25] DEBUG (__init__:39) Detecting subclass for https://bugzilla.redhat.com/xmlrpc.cgi [10:52:25] INFO (__init__:46) Using RHBugzilla for URL containing bugzilla.redhat.com [10:52:25] INFO (__init__:114) Chose subclass RHBugzilla v0.1 [10:52:25] DEBUG (base:420) Using tokenfile=/home/crobinso/.bugzillatoken [10:52:25] DEBUG (base:537) Using cookiefile=/home/crobinso/.bugzillacookies [10:52:25] INFO (base:676) Using username/password for authentication [10:52:25] INFO (base:684) Logging in... Login failed: The username or password you entered is not valid.
I'm guessing you have some outdated python dep somewhere in your python path. Check python -c 'import sys; print sys.path' non-system paths for any stale installs.
- Cole
On Wed, Jul 22, 2015 at 10:56:26AM -0400, Cole Robinson wrote:
I'm guessing you have some outdated python dep somewhere in your python path. Check python -c 'import sys; print sys.path' non-system paths for any stale installs.
Thanks for the suggestsion - I had checked that already... but you prompted me to confirm correct operation on another F22 machine.
I compared a strace from failing vs passing /usr/bin/bugzilla. The presence of the "python-ndg_httpsclient" package on the system breaks python-bugzilla. Remove it, bugzilla works, install it again, bugzilla fails. Can anybody else confirm that result?
Regards, Joe
On 07/22/2015 02:06 PM, Joe Orton wrote:
On Wed, Jul 22, 2015 at 10:56:26AM -0400, Cole Robinson wrote:
I'm guessing you have some outdated python dep somewhere in your python path. Check python -c 'import sys; print sys.path' non-system paths for any stale installs.
Thanks for the suggestsion - I had checked that already... but you prompted me to confirm correct operation on another F22 machine.
I compared a strace from failing vs passing /usr/bin/bugzilla. The presence of the "python-ndg_httpsclient" package on the system breaks python-bugzilla. Remove it, bugzilla works, install it again, bugzilla fails. Can anybody else confirm that result?
Confirmed... that's interesting. I don't really have time to dig into it now. Can you file a bug against that package and CC me?
Thanks, Cole
The issues seems to be caused due to: https://github.com/kennethreitz/requests/blob/master/requests/__init__.py#L5...
That enables SNI on python 2 when ndg-httpsclient is available essentially. Haven't dug into this further. Probably see if we have a usable workaround (monkey patch a monkey patch?) or patch upstream in requests.
On Thu, Jul 23, 2015 at 4:17 AM Cole Robinson crobinso@redhat.com wrote:
On 07/22/2015 02:06 PM, Joe Orton wrote:
On Wed, Jul 22, 2015 at 10:56:26AM -0400, Cole Robinson wrote:
I'm guessing you have some outdated python dep somewhere in your python
path.
Check python -c 'import sys; print sys.path' non-system paths for any
stale
installs.
Thanks for the suggestsion - I had checked that already... but you prompted me to confirm correct operation on another F22 machine.
I compared a strace from failing vs passing /usr/bin/bugzilla. The presence of the "python-ndg_httpsclient" package on the system breaks python-bugzilla. Remove it, bugzilla works, install it again, bugzilla fails. Can anybody else confirm that result?
Confirmed... that's interesting. I don't really have time to dig into it now. Can you file a bug against that package and CC me?
Thanks, Cole
python-bugzilla mailing list python-bugzilla@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/python-bugzilla
https://github.com/python-bugzilla/python-bugzilla/pull/3
@Joe; this should fix the issue from the python-bugzilla perspective.
@Cole; I have justified dropping the workaround in the PR.
On Thu, Jul 23, 2015 at 1:10 PM Arun Babu Neelicattu < arun.neelicattu@gmail.com> wrote:
The issues seems to be caused due to:
https://github.com/kennethreitz/requests/blob/master/requests/__init__.py#L5...
That enables SNI on python 2 when ndg-httpsclient is available essentially. Haven't dug into this further. Probably see if we have a usable workaround (monkey patch a monkey patch?) or patch upstream in requests.
On Thu, Jul 23, 2015 at 4:17 AM Cole Robinson crobinso@redhat.com wrote:
On 07/22/2015 02:06 PM, Joe Orton wrote:
On Wed, Jul 22, 2015 at 10:56:26AM -0400, Cole Robinson wrote:
I'm guessing you have some outdated python dep somewhere in your
python path.
Check python -c 'import sys; print sys.path' non-system paths for any
stale
installs.
Thanks for the suggestsion - I had checked that already... but you prompted me to confirm correct operation on another F22 machine.
I compared a strace from failing vs passing /usr/bin/bugzilla. The presence of the "python-ndg_httpsclient" package on the system breaks python-bugzilla. Remove it, bugzilla works, install it again, bugzilla fails. Can anybody else confirm that result?
Confirmed... that's interesting. I don't really have time to dig into it now. Can you file a bug against that package and CC me?
Thanks, Cole
python-bugzilla mailing list python-bugzilla@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/python-bugzilla
On 07/23/2015 01:04 AM, Arun Babu Neelicattu wrote:
https://github.com/python-bugzilla/python-bugzilla/pull/3
@Joe; this should fix the issue from the python-bugzilla perspective.
@Cole; I have justified dropping the workaround in the PR.
Thanks, pulled now. Sorry for the delay, I've been offline a lot this month
- Cole
python-bugzilla@lists.stg.fedorahosted.org