Bug 621298
Summary: | Looks like python2.7 is breaking python-bugzilla package. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Daniel Walsh <dwalsh> | ||||||
Component: | python-bugzilla | Assignee: | Will Woods <wwoods> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 14 | CC: | christian.joensson, dmalcolm, eblake, frankly3d, jlaska, jskarvad, rhe, wwoods | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | testing_xmlrpc_cookie_handling hello_from_python_2.7 py26_still_ok | ||||||||
Fixed In Version: | python-bugzilla-0.6.1-3.fc14 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2010-08-09 18:57:44 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 611990, 620817 | ||||||||
Attachments: |
|
Description
Daniel Walsh
2010-08-04 17:42:30 UTC
bugzilla query -user dwalsh -c selinux-policy -t NEW,ASSIGNED,NEEDINFO -p RHEL -v 6 -a dwalsh --outputformat 'http://bugzilla.redhat.com/%{bug_id}' *** Bug 620434 has been marked as a duplicate of this bug. *** bugzilla/base.py: CookieTransport subclasses xmlrpclib.Transport. From the comment for its "request" method: # This is the same request() method from xmlrpclib.Transport, # with a couple additions noted below In its request method, it calls make_connection, then (eventually) calls getreply on the returned object. However, Python 2.7's xmlrpclib.Transport has changed since this method was copied: r73638 [1] split the request method up, moving most of the body into a single_request method [2]. In particular, it changed make_connection to return a httplib.HTTPConnection, rather than a httplib.HTTP, and from calling getreply() to getresponse() upon this connection instance. (see the hunk at lines 1240 vs line 1350 of [2]). A similar change was made to the make_connection method of httplib.SafeTransport. [1] http://svn.python.org/view?view=rev&revision=73638 [2] http://svn.python.org/view/python/trunk/Lib/xmlrpclib.py?r1=73638&r2=73637&pathrev=73638 Created attachment 436668 [details]
base.py modified to handle python 2.7 httplib/xmlrpclib changes
I've modified bugzilla/base.py to do the following:
1) move request() to request_with_cookies()
2) add a single_request_with_cookies() for python 2.7+
3) add some code to override the appropriate method (request or single_request) depending on what xmlrpclib provides.
I've tested it on two machines - one with python 2.6, one with python 2.7 - can one of the reporters/other interested parties please confirm the fix?
Also, Dave, I'd love it if you'd look over the way I'm overriding request/single_request in (Safe)CookieTransport and tell me if there's a cleaner way to do that.
Obviously, the best thing would be to modify xmlrpclib.Transport so it can send custom user-supplied headers along with requests - or so it handles cookies on its own. But this works. *** Bug 621030 has been marked as a duplicate of this bug. *** Carrying forward F14Alpha status from 621030 Created attachment 436932 [details]
patch (against git master) that holds the fixes described previously
Confirmed that using the updated bugzilla/base.py code inside an anaconda updates.img [1], I am able to file bugs directly from the install environment (see example bug#621659). This would resolve the Alpha release criteria issue. Note, the updates.img is intended for use with F-14-Alpha TC#2, and contains code to intentionally trigger an exception. [1] http://jlaska.fedorapeople.org/updates/621298.img Tested on Python 2.7 with: WORKS: "bugzilla info -p" WORKS: "bugzilla login" with bad username of password WORKS: "bugzilla login" with correct username/password combination I've applied the patch from comment #8 to dist-git and pushed to "f14/master" and "master" Building into f14 as: http://koji.fedoraproject.org/koji/taskinfo?taskID=2382843 Building into rawhide as: http://koji.fedoraproject.org/koji/taskinfo?taskID=2382848 python-bugzilla-0.6.1-3.fc14 has been submitted as an update for Fedora 14. http://admin.fedoraproject.org/updates/python-bugzilla-0.6.1-3.fc14 This should be in ON_QA ... not sure why bodhi didn't change the state. python-bugzilla-0.6.1-3.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. *** Bug 620932 has been marked as a duplicate of this bug. *** *** Bug 623299 has been marked as a duplicate of this bug. *** |