Skip to content

Conversation

@ChristianGeie
Copy link
Collaborator

The problem is that the request() function does not return a response object in the event of an error (e.g., after MaxRetryError), but rather None.
However, the code always calls .text or .content on the return object, which leads to AttributeError: ‘NoneType’ object has no attribute ‘text’.

Fix:

Always return a response-like object in the request() function, even in the event of an error.
AND check in the calling code whether the result is None before using .text or .content.

@ChristianGeie ChristianGeie added enhancement New feature or request github_actions Pull requests that update Github_actions code python Pull requests that update Python code labels Aug 15, 2025
@ChristianGeie ChristianGeie merged commit 630e256 into master Aug 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github_actions Pull requests that update Github_actions code python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants