Comment 0 for bug 1970267

Revision history for this message
Steve Beattie (sbeattie) wrote :

Upstream bug report: https://github.com/go-macaroon-bakery/py-macaroon-bakery/issues/88

See above for details, but the essential bug is that doing something like the following:

    client = httpbakery.Client(cookies=MozillaCookieJar(".cooklefile"))

    if os.path.exists(client.cookies.filename):
        client.cookies.load(ignore_discard=True)

    response = client.request("POST", url=url, json=payload)
    client.cookies.save(ignore_discard=True)

stated throwing a traceback under python3.10:

  [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

because py-macaroon-bakery creates a http.cookiejar.Cookie() object with the rest field set to None, causing the writing out of a cookie file to fail.