)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":37762,"name":"Anders Sandahl","display_name":"Hellfish","email":"sandahl_anders@hotmail.com"},"change_message_id":"161600152e2a7ad2f3fb5e604510962d47b15331","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"92389990_1df42c48","updated":"2025-02-24 14:59:42.000000000","message":"Stumbled into the same problem and this proposes fix did not resolve;\n`AttributeError: \u0027Response\u0027 object has no attribute \u0027http_status\u0027`\n\nThis did resolve it, at least for me;\n```\n-                error \u003d exc.response and exc.response.json().get(\"error\")\n+                try:\n+                    error \u003d exc.response.json().get(\"error\")\n+                except ValueError:\n+                    raise\n```","commit_id":"d014519056cb409e1316bbd6beb30d751f3098fe"}],"keystoneauth1/identity/v3/oidc.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2bd6ba0ec68abe13d61a42a8cfb23457a167fd06","unresolved":true,"context_lines":[{"line_number":995,"context_line":"                    )"},{"line_number":996,"context_line":"            except exceptions.http.BadRequest as exc:"},{"line_number":997,"context_line":"                try:"},{"line_number":998,"context_line":"                    error \u003d exc.response.json().get(\"error\")"},{"line_number":999,"context_line":"                except ValueError"},{"line_number":1000,"context_line":"                    raise"},{"line_number":1001,"context_line":"                if error !\u003d \"authorization_pending\":"}],"source_content_type":"text/x-python","patch_set":3,"id":"98c5468c_e9a2ddba","line":998,"updated":"2025-02-24 15:30:15.000000000","message":"mypy is correctly warning here because `exc.response` could be `None`.\n\n```\nkeystoneauth1/identity/v3/oidc.py: note: In member \"_get_access_token\" of class \"OidcDeviceAuthorization\":\nkeystoneauth1/identity/v3/oidc.py:997:25: error: Item \"Response\" of \"Optional[Response]\" has no attribute \"http_status\"  [union-attr]\nkeystoneauth1/identity/v3/oidc.py:997:25: error: Item \"None\" of \"Optional[Response]\" has no attribute \"http_status\"  [union-attr]\nkeystoneauth1/identity/v3/oidc.py:997:54: error: Item \"None\" of \"Optional[Response]\" has no attribute \"json\"  [union-attr]\n```\n\nYes, we\u0027re handling this via try-except but mypy doesn\u0027t know that.\n\nRather than using the `try-except`, can we just do e.g.\n\n```\nif exc.response is not None:\n    raise\n\nerror \u003d exc.response.json().get(\u0027error\u0027)\n```","commit_id":"11bd09431aa9bb0ae51301c69abe440dc2e17c62"}]}
