[New-bugs-announce] [issue17251] LWPCookieJar load() set domain_specifed wrong

B. Kyven report at bugs.python.org
Wed Feb 20 07:48:33 CET 2013

New submission from B. Kyven:


I am using LWPCookieJar to store cookies. But I am having trouble.
Saving is fine, load is wrong. I use Cookie.domain_specified to judge if domain exist.

save the following to test.lwp
Set-Cookie3: name=value; path="/ddd/"; domain=".domain.com"; path_spec; domain_dot; secure; expires="2030-05-09 14:25:11Z"; version=0
Set-Cookie3: name=value; path="/ddd/"; domain="www.domain.com"; path_spec; secure; expires="2030-05-09 14:25:11Z"; version=0

>cj = LWPCookieJar('test.lwp').load()
>for c in cj:
>    print c.domain, c.domain_specified, c.domain_initial_dot

.domain.com       True      True
www.domain.com  **False**   True

If understood correctly, domain_specified should equal bool(c.domain ="").

This is seen on 2.7 and 2.6.

components: Library (Lib)
messages: 182476
nosy: B. Kyven
priority: normal
severity: normal
status: open
title: LWPCookieJar load() set domain_specifed wrong
type: behavior
versions: Python 2.6, Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list