You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a workaround, we can reach into the APIClient object and call .http.close() directly, but that seems brittle:
client=customerio.APIClient(CUSTOMERIO_APP_API_KEY)
request=customerio.SendEmailRequest(...)
client.send_email(request)
client.http.close() # <-- manually close the session
Here's an idea of how this could work in the API client. It'd be nice if APIClient supported the Context Manager protocol, so that we could use it like this:
I'm getting a Python
ResourceWarning
when following the examples from the Customer.io Python docs:I believe the issue is that
customerio.APIClient
never closes the RequestsSession
object (see https://stackoverflow.com/questions/48160728/resourcewarning-unclosed-socket-in-python-3-unit-test). I couldn't find a documented method onAPIClient
to close the session either.As a workaround, we can reach into the
APIClient
object and call.http.close()
directly, but that seems brittle:Here's an idea of how this could work in the API client. It'd be nice if
APIClient
supported the Context Manager protocol, so that we could use it like this:This relates to #27 and #31.
The text was updated successfully, but these errors were encountered: