Skip to content
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

Closing Connection Session #110

Open
BEAdi opened this issue Nov 10, 2022 · 1 comment
Open

Closing Connection Session #110

BEAdi opened this issue Nov 10, 2022 · 1 comment

Comments

@BEAdi
Copy link

BEAdi commented Nov 10, 2022

_TAXIIEndpoint instances, and the ones that inherit from it, have context managers that do not implement the __del__ method.
This causes sessions in_HTTPConnection not to be closed by default when not using with, because the __exit__ method is not called.

Proposed solution: Add a __del__ method to _TAXIIEndpoint class, or implement a similar context manager (with a __del__ method) in _HTTPConnection class.

Related to #37.

@chisholm
Copy link
Contributor

... context managers that do not implement the __del__ method. ...

... implement a similar context manager (with a __del__ method) ...

As far as I know, context managers don't have a __del__ method. See: Context Manager Types, With Statement Context Managers. They only have __enter__ and __exit__.

This issue seems like saying it's a problem that connections aren't closed if you don't call close(). I think programmers should just remember to call close(), or use a with statement to ensure it gets called. I am skeptical that it should be linked to a finalizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants