Skip to content

fix: Resolve error when creating EventError(...) with message=None #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Jul 22, 2024

📝 Description

This pull request resolves a bug that would cause the following error when attempting to create an EventError with a None message value:

TypeError: object of type 'NoneType' has no len()

This situations is very uncommon but it did cause issues when testing against a non-production environment.

✔️ How to Test

The following test steps assume you have pulled down this PR locally and run make install.

Unit Testing

make testunit

Manual Testing

  1. In a Python SDK sandbox environment (e.g. dx-devenv), run the following:
from linode_api4.polling import EventError

print(EventError(123, None))
  1. Ensure no TypeError is raised and the following is printed:
Event 123 failed

@lgarber-akamai lgarber-akamai added the bugfix for any bug fixes in the changelog. label Jul 22, 2024
@lgarber-akamai lgarber-akamai marked this pull request as ready for review July 22, 2024 17:43
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner July 22, 2024 17:43
@lgarber-akamai lgarber-akamai requested review from jriddle-linode and yec-akamai and removed request for a team July 22, 2024 17:43
Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Works well on my end! Nice work catching the bug

@lgarber-akamai lgarber-akamai merged commit d04a1a1 into linode:dev Jul 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix for any bug fixes in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants