diff --git a/erepublik/_logging.py b/erepublik/_logging.py index 2e32f00..79bb706 100644 --- a/erepublik/_logging.py +++ b/erepublik/_logging.py @@ -112,7 +112,7 @@ class ErepublikErrorHTTTPHandler(handlers.HTTPHandler): def _get_last_response(self) -> Dict[str, str]: response = self.reporter.citizen.r - url = response.url + url = str(response.url) last_index = url.index("?") if "?" in url else len(response.url) name = slugify(response.url[len(self.reporter.citizen.url) : last_index]) diff --git a/erepublik/citizen.py b/erepublik/citizen.py index abd4858..6359b01 100644 --- a/erepublik/citizen.py +++ b/erepublik/citizen.py @@ -613,7 +613,10 @@ class BaseCitizen(access_points.CitizenAPI): "comment_url", "rfc2109", ] - cookies = [{attr: getattr(cookie, attr) for attr in cookie_attrs} for cookie in self._req.cookies] + cookies = [] + for cookie in self._req.cookies.jar: + cookies.append({attr: getattr(cookie, attr, None) for attr in cookie_attrs if hasattr(cookie, attr)}) + #cookies = [{attr: getattr(cookie, attr) for attr in cookie_attrs} for cookie in self._req.cookies] with open(filename, "w") as f: utils.json_dump(