Author kapsh
Recipients kapsh
Date 2019-02-19.18:26:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550600762.69.0.583891908165.issue36043@roundup.psfhosted.org>
In-reply-to
Content
FileCookieJar and it's subclasses don't accept Paths and DirEntrys.
Minimal code to reproduce:

===

import pathlib
from http.cookiejar import FileCookieJar

saved_cookies = pathlib.Path('my_cookies.txt')
jar = FileCookieJar(saved_cookies)

===

Results in: "ValueError: filename must be string-like".
Workaround is to convert Path explicitly or call load() which doesn't check for type, but it would be nice to see all APIs in standard library consistent.

I also did quick and dirty patch which silently converts filename argument using os.fspath(). This way it won't break any existing code relying on FileCookieJar.filename being string.
History
Date User Action Args
2019-02-19 18:26:02kapshsetrecipients: + kapsh
2019-02-19 18:26:02kapshsetmessageid: <1550600762.69.0.583891908165.issue36043@roundup.psfhosted.org>
2019-02-19 18:26:02kapshlinkissue36043 messages
2019-02-19 18:26:02kapshcreate