You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: Ubuntu 22.04 LTS with python 3.10.4 and py-macaroon-bakery 1.3.1
With the move to python 3.10, attempts to store macaroons in http.cookiejar.MozillaCookieJar format files fail. Essentally, I have code that does the following:
Under python 3.10, this causes a traceback in the call to client.cookies.save() like so:
[ELIDED]
File "/usr/lib/python3.10/http/cookiejar.py", line 2120, in save
if cookie.has_nonstandard_attr(HTTPONLY_ATTR):
File "/usr/lib/python3.10/http/cookiejar.py", line 805, in has_nonstandard_attr
return name in self._rest
TypeError: argument of type 'NoneType' is not iterable
In python 3.10 the commit python/cpython@16ee68d adds a check for the HTTP Only flag in the MozillaCookieJar class, and in particular, this is checked for before writing out the cookie file via Cookie.has_nonstandard_attr() like so:
OS: Ubuntu 22.04 LTS with python 3.10.4 and py-macaroon-bakery 1.3.1
With the move to python 3.10, attempts to store macaroons in
http.cookiejar.MozillaCookieJar
format files fail. Essentally, I have code that does the following:Under python 3.10, this causes a traceback in the call to
client.cookies.save()
like so:In python 3.10 the commit python/cpython@16ee68d adds a check for the HTTP Only flag in the MozillaCookieJar class, and in particular, this is checked for before writing out the cookie file via
Cookie.has_nonstandard_attr()
like so:(see
https://github.com/python/cpython/blob/16ee68da6e12bb2d79751b32cc37523fe4f4bb48/Lib/http/cookiejar.py#L2120 )
Cookie.has_nonstandard_attr()
is implemented as the following:(see https://github.com/python/cpython/blame/main/Lib/http/cookiejar.py#L803 )
Unfortunately,
macaroonbakery/_utils/__init__.py.cookie()
creates aCookie
class withrest=None
py-macaroon-bakery/macaroonbakery/_utils/__init__.py
Line 163 in df0e18f
None
.Fixing (or working around, depending on whether you believe this is a bug in python's cookiejar) this in py-macaroon-bakery should be as simple as:
The text was updated successfully, but these errors were encountered: