PyIRC issueshttps://code.foxkit.us/IRC/PyIRC/-/issues2021-02-28T05:21:55Zhttps://code.foxkit.us/IRC/PyIRC/-/issues/18taillight.signal.SignalDeferralSenderError after SASL failure when running wi...2021-02-28T05:21:55ZMax Reestaillight.signal.SignalDeferralSenderError after SASL failure when running with taillight 0.4On git master, after applying the following patch to run with taillight 0.4+:
```patch
From 20e6d288e80752aafb915b575133a01f0e6e2f54 Mon Sep 17 00:00:00 2001
From: Max Rees <maxcrees@me.com>
Date: Sat, 28 Sep 2019 19:42:45 -0500
Subject...On git master, after applying the following patch to run with taillight 0.4+:
```patch
From 20e6d288e80752aafb915b575133a01f0e6e2f54 Mon Sep 17 00:00:00 2001
From: Max Rees <maxcrees@me.com>
Date: Sat, 28 Sep 2019 19:42:45 -0500
Subject: [PATCH] Bump taillight to 0.4
---
PyIRC/base.py | 4 +++-
PyIRC/extensions/cap.py | 4 ++--
PyIRC/signal.py | 4 ++--
setup.py | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/PyIRC/base.py b/PyIRC/base.py
index 9d09da2..cc844ed 100644
--- a/PyIRC/base.py
+++ b/PyIRC/base.py
@@ -16,6 +16,8 @@ from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from logging import getLogger
+from taillight.signal import SignalStatus
+
from PyIRC.signal import SignalStorage
from PyIRC.casemapping import IRCString
from PyIRC.line import Line
@@ -285,7 +287,7 @@ class IRCBase(metaclass=ABCMeta):
"""
signal = self.signals.get_signal((hclass, event))
- if signal.last_status != signal.STATUS_DEFER:
+ if signal.last_status != SignalStatus.STATUS_DEFER:
return
return self.call_event(hclass, event)
diff --git a/PyIRC/extensions/cap.py b/PyIRC/extensions/cap.py
index 234bece..16ca007 100644
--- a/PyIRC/extensions/cap.py
+++ b/PyIRC/extensions/cap.py
@@ -16,7 +16,7 @@ http://ircv3.net/specs/core/capability-negotiation-3.2.html
from functools import partial
from logging import getLogger
-from taillight.signal import SignalStop
+from taillight.signal import SignalStatus, SignalStop
from PyIRC.signal import event
from PyIRC.extensions import BaseExtension
@@ -240,7 +240,7 @@ class CapNegotiate(BaseExtension):
caps[cap] = self.local[cap] = params
signal = self.signals.get_signal(("cap_perform", "ack"))
- if signal.last_status == signal.STATUS_DEFER:
+ if signal.last_status == SignalStatus.STATUS_DEFER:
# We are still processing a previous chain
self.ack_chains.append((line, caps))
else:
diff --git a/PyIRC/signal.py b/PyIRC/signal.py
index 60989bc..57f6552 100644
--- a/PyIRC/signal.py
+++ b/PyIRC/signal.py
@@ -12,14 +12,14 @@ from enum import Enum
from inspect import getmembers
from logging import getLogger
-from taillight.signal import UnsharedSignal
+from taillight.signal import SignalPriority, UnsharedSignal
from taillight import ANY
_logger = getLogger(__name__) # pylint: disable=invalid-name
-def event(hclass, event_name, priority=UnsharedSignal.PRIORITY_NORMAL,
+def event(hclass, event_name, priority=SignalPriority.PRIORITY_NORMAL,
listener=ANY):
"""Tag a function as an event for later binding.
diff --git a/setup.py b/setup.py
index e82f35e..0bd6edb 100755
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ setup(name="PyIRC",
url="https://foxkit-us.github.io/PyIRC",
packages=["PyIRC", "PyIRC.formatting", "PyIRC.extensions", "PyIRC.util",
"PyIRC.io", "PyIRC.extensions.ircd"],
- install_requires=["taillight >= 0.2b4"],
+ install_requires=["taillight >= 0.4"],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
--
2.22.1
```
A ``taillight.signal.SignalDeferralSenderError`` exception is thrown if SASL authentication fails:
```console
mcrees@sachiel ~/src/contrib/PyIRC % python3 examples/test_socket.py
[*] -joestar.interlinked.me- *** Looking up your hostname...
[*] -joestar.interlinked.me- *** Checking Ident
[*] -joestar.interlinked.me- *** Found your hostname
[*] -joestar.interlinked.me- *** No Ident response
--> AUTHENTICATE +
--> !!! ERR_SASLFAIL [904] * SASL authentication failed
CRITICAL:PyIRC.extensions.sasl:No SASL auth methods were successful.
Traceback (most recent call last):
File "examples/test_socket.py", line 30, in <module>
i.loop()
File "/usr/lib/python3.6/site-packages/PyIRC/io/socket.py", line 123, in loop
self.recv()
File "/usr/lib/python3.6/site-packages/PyIRC/io/socket.py", line 111, in recv
super().recv(line)
File "/usr/lib/python3.6/site-packages/PyIRC/formatting/pprint.py", line 252, in recv
return super().recv(line)
File "/usr/lib/python3.6/site-packages/PyIRC/base.py", line 311, in recv
self.call_event("commands", command, line)
File "/usr/lib/python3.6/site-packages/PyIRC/base.py", line 274, in call_event
return (event, signal.call(event, *args, **kwargs))
File "/usr/lib/python3.6/site-packages/taillight/signal.py", line 573, in call
ret.append(slot(sender, *args, **kwargs))
File "/usr/lib/python3.6/site-packages/taillight/slot.py", line 62, in __call__
return self.function(caller, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/PyIRC/extensions/sasl.py", line 177, in fail
self.resume_event("cap_perform", "ack")
File "/usr/lib/python3.6/site-packages/PyIRC/base.py", line 293, in resume_event
return self.call_event(hclass, event)
File "/usr/lib/python3.6/site-packages/PyIRC/base.py", line 274, in call_event
return (event, signal.call(event, *args, **kwargs))
File "/usr/lib/python3.6/site-packages/taillight/signal.py", line 558, in call
raise SignalDeferralSenderError("deferred signal sender "
taillight.signal.SignalDeferralSenderError: deferred signal sender unexpectedly changed
```https://code.foxkit.us/IRC/PyIRC/-/issues/16ECDSA-NIST256P-CHALLENGE SASL support2019-09-02T19:55:45ZElizabeth MyersECDSA-NIST256P-CHALLENGE SASL supportSee #3 for background.See #3 for background.Elizabeth MyersElizabeth Myershttps://code.foxkit.us/IRC/PyIRC/-/issues/12Extension to smooth over IRC daemon specific stuff2019-09-02T19:55:45ZElizabeth MyersExtension to smooth over IRC daemon specific stuffI think there should be a submodule in extensions called `ircd`, which has a further submodule that has an extension that loads an IRC daemon-specific extension, depending on the IRC daemon discovered at runtime (this can rarely be known...I think there should be a submodule in extensions called `ircd`, which has a further submodule that has an extension that loads an IRC daemon-specific extension, depending on the IRC daemon discovered at runtime (this can rarely be known in advance, and even so, should be autodetected anyway; people change IRC daemons sometimes).
This sounds complicated but it really isn't that bad. Basically you'd have `PyIRC.extension.ircd.advancedapi` or so. This imports the appropriate extension for that IRC daemon that implements the API. This can be used for emitting STATS events in an independent way, handling extban parsing (inspircd uses the abominable extban chaining, whereas charybdis doesn't, for example), and more.
With the advanced API, callouts could also be provided similar to `basicapi`. You can call the advanced API functions, and it will provide IRC daemon specific functionality transparently to you, without fucking around with it manually.
Thoughts?
First releasehttps://code.foxkit.us/IRC/PyIRC/-/issues/10Investigate use of a library for extension discovery2019-09-02T19:55:45ZElizabeth MyersInvestigate use of a library for extension discoveryThis may be of use: https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins and would be better than the present hack in place to find extensions.
Right now there can be multiple extensions per file, which we actually ...This may be of use: https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins and would be better than the present hack in place to find extensions.
Right now there can be multiple extensions per file, which we actually use (for SASL and for altnick). Does this have to change?https://code.foxkit.us/IRC/PyIRC/-/issues/7Unit tests2019-09-02T19:55:45ZElizabeth MyersUnit testsWe need unit tests! Mocking things is probably the way to go here for anything network-based. The library should be pretty easy to write tests for.We need unit tests! Mocking things is probably the way to go here for anything network-based. The library should be pretty easy to write tests for.First releasehttps://code.foxkit.us/IRC/PyIRC/-/issues/5gevent I/O backend2019-09-02T19:55:45ZElizabeth Myersgevent I/O backendA gevent I/O backend is probably desirable. However, gevent for Python 3 is in a state best described as "not ready," and the gevent maintainer's opinion on Python 3 is rather... well, low. Don't hold your breath on working mainlined Pyt...A gevent I/O backend is probably desirable. However, gevent for Python 3 is in a state best described as "not ready," and the gevent maintainer's opinion on Python 3 is rather... well, low. Don't hold your breath on working mainlined Python 3 support in gevent. You'll turn blue and pass away.
The socket backend probably works with monkey patching, but a more "native" one using green threads and gevent's scheduler is probably more ideal.
In the meantime @fantix's fork is probably the best option if anyone wants this.https://code.foxkit.us/IRC/PyIRC/-/issues/4Allow extensions to be reloaded2019-09-02T19:55:45ZElizabeth MyersAllow extensions to be reloadedExtensions should be reloadable at runtime, but there needs to be a way to serialise their state. I am thinking a callback in the extension to serialise needed state. However, perhaps bad state is the reason reloading is being done? I do...Extensions should be reloadable at runtime, but there needs to be a way to serialise their state. I am thinking a callback in the extension to serialise needed state. However, perhaps bad state is the reason reloading is being done? I don't know how to handle this...https://code.foxkit.us/IRC/PyIRC/-/issues/2DCC support2019-09-02T19:55:44ZElizabeth MyersDCC supportDCC support should be added.
List of general information about implementing it:
* CHAT and SEND are probably sufficient for this library's needs. Anything else has spotty implementation and poor interoperability. Interoperability is ...DCC support should be added.
List of general information about implementing it:
* CHAT and SEND are probably sufficient for this library's needs. Anything else has spotty implementation and poor interoperability. Interoperability is king.
* Do any users care about DCC support?
* DCC is slowly dying - this **may** not be worth implementing.
* It should probably be put in an extension, with optional asyncio and socket implementations.
* Any socket implementation should probably use threads or something to avoid blocking.
* A way to initiate and a way to send are both needed, so listeners and senders are needed.