-
Notifications
You must be signed in to change notification settings - Fork 59
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
Cannot close underlying sockets #137
Comments
From what I can tell, the socket should be closed after I can submit a PR for this but I am slightly concerned that this project is dead/dying. |
elParaguayo
added a commit
to elParaguayo/python-dbus-next
that referenced
this issue
Jan 7, 2023
As per issue altdesktop#137, sockets are not closed when the bus is disconnected. This results in users receiving warnings about unclosed sockets. This PR adds a call to the socket's `close` method during `disconnect`. Closes altdesktop#137
garyvdm
pushed a commit
to garyvdm/dbus-ezy
that referenced
this issue
May 9, 2024
As per issue altdesktop#137, sockets are not closed when the bus is disconnected. This results in users receiving warnings about unclosed sockets. This PR adds a call to the socket's `close` method during `disconnect`. Closes altdesktop#137
garyvdm
pushed a commit
to garyvdm/dbus-ezy
that referenced
this issue
May 10, 2024
As per issue altdesktop#137, sockets are not closed when the bus is disconnected. This results in users receiving warnings about unclosed sockets. This PR adds a call to the socket's `close` method during `disconnect`. Closes altdesktop#137
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created several instances and got ResourceWarnings as follows:
/usr/lib/python3.6/site-packages/dbus_next/introspection.py:172: ResourceWarning: unclosed <socket.socket fd=26, family=AddressFamily.AF_UNIX, type=2049, proto=0, raddr=/run/dbus/system_bus_socket>
Looking into the source code, it seems that there is no place that closes bus underlying sockets.
There is the method disconnect() that calls shutdown() but not close().
There is the method _finalize().
However I am not sure how to use these.
Close() is never called.
I am currently using the following, which is awkward and not sure if correct:
bus.disconnect()
bus._finalize()
await bus.wait_for_disconnect()
bus._sock.close()
Any idea how to correctly close sockets?
The text was updated successfully, but these errors were encountered: