Message335993
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. |
|
Date |
User |
Action |
Args |
2019-02-19 18:26:02 | kapsh | set | recipients:
+ kapsh |
2019-02-19 18:26:02 | kapsh | set | messageid: <1550600762.69.0.583891908165.issue36043@roundup.psfhosted.org> |
2019-02-19 18:26:02 | kapsh | link | issue36043 messages |
2019-02-19 18:26:02 | kapsh | create | |
|