Skip to content
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

Listener inadequate errors randomly appearing #57

Open
rri-reds opened this issue Jan 3, 2024 · 0 comments
Open

Listener inadequate errors randomly appearing #57

rri-reds opened this issue Jan 3, 2024 · 0 comments

Comments

@rri-reds
Copy link

rri-reds commented Jan 3, 2024

Hello,

I am using pypubsub in the context of a program that uses cocotb to test some HDL code. I have a LARGE number of publisher and subscribers, and in the past few days I have started to receive this kind of errors:

INFO     cocotb:simulator.py:302 #   2500.00ns ERROR    root                               Listener "MyFun._myhandler" (from module "MyFun") inadequate: required args (msg) not allowed (could curry them), topic has no required args (params (msg) are req'd in listener, optional in topic )
INFO     cocotb:simulator.py:302 #                                                         Traceback (most recent call last):
INFO     cocotb:simulator.py:302 #                                                           File "MY_PATH/test.py", line 138, in run_test
INFO     cocotb:simulator.py:302 #                                                             myfun = MyFun(config)
INFO     cocotb:simulator.py:302 #                                                           File "MY_PATH/MyFun.py", line 67, in __init__
INFO     cocotb:simulator.py:302 #                                                             pub.subscribe(self._myhandler, mytopic)
INFO     cocotb:simulator.py:302 #                                                           File "MY_PATH/.tox/py3/lib/python3.7/site-packages/pubsub/core/publisher.py", line 160, in subscribe
INFO     cocotb:simulator.py:302 #                                                             subscribedListener, success = topicObj.subscribe(listener, **curriedArgs)
INFO     cocotb:simulator.py:302 #                                                           File "MY_PATH/.tox/py3/lib/python3.7/site-packages/pubsub/core/topicobj.py", line 356, in subscribe
INFO     cocotb:simulator.py:302 #                                                             argsInfo = self.__validator.validate(listener, curriedArgNames=curriedArgs)
INFO     cocotb:simulator.py:302 #                                                           File "MY_PATH/.tox/py3/lib/python3.7/site-packages/pubsub/core/listener.py", line 274, in validate
INFO     cocotb:simulator.py:302 #                                                             self.__validateArgs(listener, paramsInfo, curriedArgNames)
INFO     cocotb:simulator.py:302 #                                                           File "MY_PATH/.tox/py3/lib/python3.7/site-packages/pubsub/core/listener.py", line 333, in __validateArgs
INFO     cocotb:simulator.py:302 #                                                             raise ListenerMismatchError(msg, listener, extraArgs)
INFO     cocotb:simulator.py:302 #                                                         pubsub.core.callables.ListenerMismatchError: Listener "MyFun._myhandler" (from module "MyFun") inadequate: required args (msg) not allowed (could curry them), topic has no required args (params (msg) are req'd in listener, optional in topic )

Please do note that I have not touched the file in question (I was working on a totally unrelated file, with totally unrelated topics...).
Has anyone got a clue about why this is happening?
I can easily circumvent the error by putting the argument as optional in the handler and then putting an assert to ensure that the argument value is not None, but this is quite annoying...

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant