-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
ResourceWarnings in test_reconnects_are_stable #224
Comments
|
I tried adding a disconnect at the end. diff --git a/irc/tests/test_bot.py b/irc/tests/test_bot.py
index 213eca3..c91a897 100644
--- a/irc/tests/test_bot.py
+++ b/irc/tests/test_bot.py
@@ -139,6 +139,7 @@ class TestBot:
bot.reactor.process_once()
time.sleep(0.01)
assert len(bot.reactor.scheduler.queue) <= 1
+ bot.disconnect()
def test_version(): But that made matters worse:
|
I managed to get a bit more detail about what's happening by passing
|
I suspect the issue lies in the Client.disconnect method: Lines 523 to 543 in 2f6ba71
After learning a bit about the relationship between socket.shutdown and socket.close, I'm pretty sure the issue is that Indeed, applying the following diff, there are no more resource warnings: diff --git a/irc/client.py b/irc/client.py
index 4d269a9..52262f3 100644
--- a/irc/client.py
+++ b/irc/client.py
@@ -532,13 +532,15 @@ class ServerConnection(Connection):
except AttributeError:
return
- self.quit(message)
+ # self.quit(message)
try:
self.socket.shutdown(socket.SHUT_WR)
- self.socket.close()
except OSError:
pass
+
+ self.socket.close()
+
del self.socket
self._handle_event(Event("disconnect", self.server, "", [message]))
|
Oof. The |
Oh! I don't need to be concerned about |
Here's the more info.
The text was updated successfully, but these errors were encountered: