curl-and-python

Re: Curl Object - unset range option

From: Michael Wood <esiotrot_at_gmail.com>
Date: Wed, 13 Jul 2011 09:24:26 +0200

On 13 July 2011 01:05, Konstantinos Botsaris <cosbots_at_gmail.com> wrote:
>
> On 12 Jul 2011, at 22:39, Daniel Stenberg wrote:
>
>> On Tue, 12 Jul 2011, Konstantinos Botsaris wrote:
>>
>>>>> I would like to ask if there is a way to unset the header option which was previously set
>>
>>>> You probably need to check the pycurl code so that 'None' truly equals setting the underlying option to NULL.
>>>
>>> Can you be a little bit more specific of what exactly I should do ? Thanks
>>
>> Custom headers are possible to "unset" when using the plain C API. You probably need to make sure that the python binding is doing it the proper way.
>>
>> --
>>
>> / daniel.haxx.se
>> _______________________________________________
>> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>
> Ok I will try that  Daniel. Thanks again!

In src/pycurl.c there is the following line:

static char co_unsetopt_doc [] = "unsetopt(option) -> None. Reset
curl session option to default value. Throws pycurl.error exception
upon failure.\n";

So perhaps you could try c.unsetopt(...) instead of c.setopt(..., None).

-- 
Michael Wood <esiotrot_at_gmail.com>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2011-07-13