-
Notifications
You must be signed in to change notification settings - Fork 197
TypeError: '>=' not supported between instances of 'int' and 'NoneType' when running the gc #184
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
Comments
With this fix #188 I could successfully run your example with pytest on python 3 without any problem, while on python 2 I still receive some issues to close all resources properly. It seems pytest or python2 is destroying some resources earlier than it should be. While if I run your example as a python script, then I will not get any error now. So the best practice I would suggest is: mange the resources properly, a.k.a close the driver yourself rather than relying on closing when the object is out of scope. |
Hi @tardyp, I am closing this issue as we've already fixed what we could fix in #188 The key is still to close the resources. It is still suggested to explicitly to close driver/session/tx to avoid any possible connection leaks in your app. If you still have any problem regarding this card, be free to reopen it. Cheers, |
Hi!
Every time django server is reloading or tests finished this message appears. As a workaround I use import atexit
driver = GraphDatabase.driver(...)
atexit.register(lambda: driver.close()) |
Got the same issue as well. |
@jeicoo It should be. You shall not get the error on Python3. |
@zhenlineo thank you for the response! |
@zhenlineo yes, as you mentioned in the previous comment to shut down the driver properly. I will keep that in mind. Thank you for the link that you gave! It looks like that will solve my problem. I was hoping to find the solution to this issue but you showed me on how to handle exit event in pyramid as well. Much appreciated! @TvoroG thank you for sharing your solution! Will let you guys know once I solved my problem. |
@zhenlineo the workaround you gave worked for me! Thanks a lot! |
How to reproduce easily
pip install pytest neo4j-driver
write a file 'test_neo.py' :
Looks like similar issue here:
johanlundberg/neo4j-django-tutorial#10
I am not sire exactly, but it looks like somehow the INFO variable is reset to None at some point. I am not sure if this is because of neo4j-driver or because of pytest
The text was updated successfully, but these errors were encountered: