Message367468
Also confused about why this was closed.
This format is still frequently used. In the absence of a solution in the standard library, I'm using this kludge to strip the leading `#HttpOnly_`.
from tempfile import NamedTemporaryFile
from http.cookiejar import MozillaCookieJar
from contextlib import contextmanager
def fix_cookie_jar_file(orig_cookiejarfile):
with NamedTemporaryFile(mode='w+') as cjf:
with open(orig_cookiejarfile, 'r') as ocf:
for l in ocf:
cjf.write(l[10:] if l.startswith('#HttpOnly_') else l)
cjf.seek(0)
yield cjf.name
MozillaCookieJar(filename=fix_cookie_jar_file(orig_cookiejarfile)) |
|
Date |
User |
Action |
Args |
2020-04-27 22:19:23 | dlenski | set | recipients:
+ dlenski, loewis, terry.reedy, jjlee, douyuan, jdetrey, mt0321 |
2020-04-27 22:19:23 | dlenski | set | messageid: <1588025963.39.0.575692765418.issue2190@roundup.psfhosted.org> |
2020-04-27 22:19:23 | dlenski | link | issue2190 messages |
2020-04-27 22:19:23 | dlenski | create | |
|