Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ types-cachetools==4.2.10
types-requests==2.28.11.5
types-urllib3==1.26.25.4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Upgrading urllib3 to 2.6.0 with requests==2.28.1 causes AttributeError due to missing HTTPResponse methods.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

Upgrading urllib3 to version 2.6.0 introduces an incompatibility with the pinned requests version 2.28.1. urllib3 2.6.0 removed HTTPResponse.getheaders() and HTTPResponse.getheader(), which requests 2.28.1 internally relies on in its HTTPAdapter.build_response() method. This will lead to an AttributeError: 'HTTPResponse' object has no attribute 'getheaders' whenever an HTTP request is made using requests.get(), causing the application to crash as there is no error handling.

💡 Suggested Fix

Upgrade requests to version 2.30.0 or newer, which officially supports urllib3 2.x. Alternatively, downgrade urllib3 to a 1.x version compatible with requests==2.28.1.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: requirements.txt#L80

Potential issue: Upgrading `urllib3` to version 2.6.0 introduces an incompatibility with
the pinned `requests` version 2.28.1. `urllib3` 2.6.0 removed
`HTTPResponse.getheaders()` and `HTTPResponse.getheader()`, which `requests` 2.28.1
internally relies on in its `HTTPAdapter.build_response()` method. This will lead to an
`AttributeError: 'HTTPResponse' object has no attribute 'getheaders'` whenever an HTTP
request is made using `requests.get()`, causing the application to crash as there is no
error handling.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6416724

typing_extensions==4.4.0
urllib3==1.26.13
urllib3==2.6.0
watchdog==2.2.0
websockets==10.4
wrapt==1.16.0
Expand Down