-
Notifications
You must be signed in to change notification settings - Fork 379
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
Prototype error for CMessage.GetParamsColon on Python #1749
Comments
Can you show your code? |
It is pretty much in the traceback, which is why I didn't post it. It is just a global module, with the hook in it, and the line of the exception. # paramcolonexample.py
import traceback
import znc
class paramcolonexample(znc.Module):
description = "Example python3 module that shows broken GetParamColon binding"
# virtual EModRet CModule::OnPrivCTCPMessage ( CCTCPMessage& Message )
def OnPrivCTCPMessage(self, message):
try:
self.PutModule("Broken binding test!")
self.PutModule("ParamsColon: " str(message.GetParamsColon(3)))
except Exception as ex:
self.PutModule("An error occurred while executing this command.")
self.PutModule(''.join(traceback.format_exception(etype=type(ex), value=ex, tb=ex.__traceback__)))
return znc.CONTINUE (Edited to add the return statement that is there in my code but forgotten about... but I might as well add it before someone is like 'you should put that in', because it is in there in reality. 😄 ) ((And edited a second time because our conversation made me realize that you couldn't see the exception because znc loves swallowing uncaught exceptions.)) |
Version: 1.8.1
The API bindings appear unhappy in Python.
Relevant lines in
/.../znc/modpython/znc_core.py
are as follows:Clearly an unsigned int cannot be -1 (why that definition on C side anyways?!), so my guess is that some code (SWIG?) chokes on this.
I have tried setting
uLen
to None in the hope it would fall back to the 1-parameter version, but no dice.Temporary workaround for anyone who needs the default for that parameter:
I don't know what the proper way is to resolve this. Regenerate SWIG? Fix the original class definition with a proper overload somehow? I leave it up to the experts. 😄
The text was updated successfully, but these errors were encountered: