-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Exception by __del__ #8504
Comments
See also OpenAPITools/openapi-generator#712 |
Has anyone looked into the problem I mentioned? It's definitely a problem when used in a non-hello-world program. I've explained it clearly I believe. Maybe I need to make a pull request for the code change? |
Seems like this is stlil going, was hit by this as well. |
This is also related to https://bugs.python.org/issue39360 and can lead to weird behaviour (hanging tests in pytest) under 3.8 Edit: that is filed under #9991 |
swagger-codegen/modules/swagger-codegen/src/main/resources/python/api_client.mustache
Lines 72 to 74 in dbd0a4b
The code causes an exception in generated api client, when an async api call is made. Take mine for example:
My marked code is:
And this is the code snippet from
/usr/lib/python3.5/multiprocessing/pool.py
:The
__del__
method is expected to run in main thread but here clearly Python runs it on a thread which istask_handler
. It's the thread that__del__
runs on, and it makes a thread try to join itself and thus throw an exception.I suggest either
try
to ignore the exception, or make it a normal "close" method to be called by user manually.The text was updated successfully, but these errors were encountered: