This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients docs@python, py.user, terry.reedy
Date 2013-01-12.02:37:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357958225.11.0.589089896723.issue16901@psf.upfronthosting.co.za>
In-reply-to
Content
First, a minor issue about class signatures:
doc: FileCookieJar(filename, delayload=None, policy=None)
code: def __init__(self, filename=None, delayload=False, policy=None)
Pretty clearly, doc should be changed to match code, as later code allow for possibility of filename = None (meaning that that is intentional).

Ditto for doc for FileCookieJar subclasses (which inherit __init__):
MozillaCookieJar(filename, delayload=None, policy=None) 
LWPCookieJar(filename, delayload=None, policy=None)

--- 
FileCookieJar has .load which in inherited by the subclasses. It checks for a filename and opens it and then calls ._really_load. The two subclasses have customized ._really_load methods that correspond to their customized .save methods.

FileCookieJar itself does not. If it did, it would have to somehow be 'generic'. This suggests to me that FileCookieJar was not intended to be directly used. This impression is reinforced by the definition of .save().

    def save(self, filename=None, ignore_discard=False, ignore_expires=False):
        """Save cookies to a file."""
        raise NotImplementedError()

In other words, there is no generic format to save to *or* load from.
There should be a corresponding ._really_load to raise the same exception.

Bottom line: as best I understand, your code is not intended to work, but both the doc and implementation are deficient in not saying so, and both should be improved.
History
Date User Action Args
2013-01-12 02:37:05terry.reedysetrecipients: + terry.reedy, docs@python, py.user
2013-01-12 02:37:05terry.reedysetmessageid: <1357958225.11.0.589089896723.issue16901@psf.upfronthosting.co.za>
2013-01-12 02:37:04terry.reedylinkissue16901 messages
2013-01-12 02:37:02terry.reedycreate