Terry J. Reedy added the comment: +class FileCookieJar(CookieJar, metaclass=ABCMeta): + """Abstract Base Class for any file-based CookieJar."""
Is it just me or is it a bit strange to derive an abstract base class from a concrete class? Is CookieJar meant to be directly used? + with open(self.filename) as f: + magic = f.readline() + if not self.magic_re.search(magic): + f.close() + raise LoadError( + "%r does not look like a Netscape format cookies f.close() seems not needed as doing that in __exit__ as a major point of with open... statements. ---------- nosy: +terry.reedy _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16942> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com