linode / linode_api4-python

Official Python bindings for the Linode API
https://linode-api4.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
135 stars 75 forks source link

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

Closed lgarber-akamai closed 1 month ago

lgarber-akamai commented 1 month ago

📝 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