Bug 896025

Summary: curl_obj.reset() does not set up the default PYCURL_ERRORBUFFER
Product: [Fedora] Fedora Reporter: Zdeněk Pavlas <zpavlas>
Component: python-pycurlAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: jzeleny, keramidasceid, kklic
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: python-pycurl-7.19.0-14.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-02 19:58:59 UTC Type: Bug
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: 832491    
Attachments:
Description Flags
Reinitialize PYCURL_ERRORBUFFER after reset
none
upstream fix
none
upstream fix V2 zpavlas: review+

Description Zdeněk Pavlas 2013-01-16 13:47:11 UTC
Description of problem:

.reset() method has some unintended side effects, breaks error reporting.

Version-Release number of selected component (if applicable):

python-pycurl-7.19.0-10.fc17.i686

How reproducible:

Always.

$ cat t.py 
import sys, pycurl
c = pycurl.Curl()
if 'reset' in sys.argv: c.reset()
c.setopt(pycurl.URL, 'http://localhost:0')
try: c.perform()
except pycurl.error, e: print e
$ python t.py 
$ python t.py reset

Actual results:

(7, "couldn't connect to host")
(7, '')

Expected results:

(7, "couldn't connect to host")
(7, "couldn't connect to host")

Additional info:

Comment 1 Zdeněk Pavlas 2013-01-18 09:32:11 UTC
Created attachment 682231 [details]
Reinitialize PYCURL_ERRORBUFFER after reset

The CURL_ERRORBUFFER option is NOT supported by pycurl (it's not exposed in Python API).  However, when a new handle is created, this option is set.  The reset() method should be consistent, and reinitialize the CURL_ERRORBUFFER option.

Comment 2 Fedora Admin XMLRPC Client 2013-02-22 21:34:29 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Kamil Dudka 2013-02-25 19:43:40 UTC
Created attachment 702502 [details]
upstream fix

The underlying problem is more general: all pycurl-specific defaults need to be reinitialized in reset().  The attached upstream patch fixes it.

Zdenek, could you please have a look at the patch before it goes to stable branches?  Thanks in advance!

Comment 4 Kamil Dudka 2013-02-25 19:58:40 UTC
fixed in python-pycurl-7.19.0-14.fc19

Comment 5 Kamil Dudka 2013-02-26 07:52:00 UTC
Created attachment 702661 [details]
upstream fix V2

I have only removed a left-over global variable introduced by the upstream patch.

Comment 6 Zdeněk Pavlas 2013-02-26 08:33:19 UTC
Yes, it's possible that pycurl defaults != curl defaults, and this should handle it nicely.  ACK and thanks!

Comment 7 Kamil Dudka 2013-02-26 09:13:15 UTC
Comment on attachment 702661 [details]
upstream fix V2

Thanks for review!  I will submit updates for stable Fedora.

Comment 8 Fedora Update System 2013-02-26 10:03:08 UTC
python-pycurl-7.19.0-11.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-pycurl-7.19.0-11.fc17

Comment 9 Fedora Update System 2013-02-26 10:03:20 UTC
python-pycurl-7.19.0-13.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-pycurl-7.19.0-13.fc18

Comment 10 Fedora Update System 2013-02-27 02:39:05 UTC
Package python-pycurl-7.19.0-11.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-pycurl-7.19.0-11.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3119/python-pycurl-7.19.0-11.fc17
then log in and leave karma (feedback).

Comment 11 Vasilis Keramidas 2013-03-01 23:44:50 UTC
 python-pycurl-7.19.0-13.fc18 fixes this bug
I left positive karma at https://admin.fedoraproject.org/updates/F18/FEDORA-2013-3157

Comment 12 Kamil Dudka 2013-03-02 18:41:40 UTC
Thank you for the confirmation, Vasilis!

Comment 13 Fedora Update System 2013-03-02 19:59:01 UTC
python-pycurl-7.19.0-13.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2013-04-09 14:33:54 UTC
python-pycurl-7.19.0-13.1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-pycurl-7.19.0-13.1.fc18

Comment 15 Fedora Update System 2013-04-09 14:34:28 UTC
python-pycurl-7.19.0-11.1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-pycurl-7.19.0-11.1.fc17

Comment 16 Fedora Update System 2013-04-09 14:34:58 UTC
python-pycurl-7.19.0-15.1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-pycurl-7.19.0-15.1.fc19

Comment 17 Fedora Update System 2013-04-20 19:25:04 UTC
python-pycurl-7.19.0-15.1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2013-04-25 00:37:32 UTC
python-pycurl-7.19.0-11.1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2013-04-25 00:44:48 UTC
python-pycurl-7.19.0-13.1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.