python: CMessage.GetParams() returns unknowns #843

Closed
opened 2026-10-05 04:48:16 +02:00 by adam · 2 comments
Owner

When using python based plugins that hook on the new-er *Message hoons (eg OnUserRawMessage), the GetParams() method on the CMessage given to the callback returns a tuple containing Swig Object of type 'unknown'.

ZNC version tested on: ZNC 1.7.0 (IPv6: yes, SSL: yes, DNS: threads, charset: yes, i18n: no, build: autoconf)
ZNC was built from source on my Ubuntu 18.04 desktop using python 3.6.5

When using python based plugins that hook on the new-er *Message hoons (eg OnUserRawMessage), the `GetParams()` method on the CMessage given to the callback returns a tuple containing `Swig Object of type 'unknown'`. ZNC version tested on: ZNC 1.7.0 (IPv6: yes, SSL: yes, DNS: threads, charset: yes, i18n: no, build: autoconf) ZNC was built from source on my Ubuntu 18.04 desktop using python 3.6.5 <!-- github-sync-id:328293219 -->
adam closed this issue 2026-10-05 04:48:16 +02:00
Author
Owner

I was asked in #znc on freenode to add some further information:

import znc

class test(znc.Module):
    description = "example case for bug report"
    module_types = [znc.CModInfo.NetworkModule]

    def OnUserRawMessage(self, msg):
        self.PutModule(str(msg.GetParams()))

above is a working test case for this bug, it will PM a response from *test on any raw message passed through znc, the PM will contain something like: (<Swig Object of type 'unknown' at 0x7f0f051c0540>, <Swig Object of type 'unknown' at 0x7f0f051c00c0>)

Also not noted in my bug report is the fact that there are swig warnings in the debug log when this occurs:

[2018-06-01 22:23:13.463902] (ad/snoodev) CLI -> ZNC [znc loadmod test]
[2018-06-01 22:23:13.465286] (ad/snoodev) ZNC -> CLI [:*status!znc@znc.in PRIVMSG ad :Loaded module test: [./modules/test.py]]
[2018-06-01 22:23:16.835922] (ad/snoodev) CLI -> ZNC [PRIVMSG *status :dasdasd]
swig/python detected a memory leak of type 'unknown', no destructor found.
swig/python detected a memory leak of type 'unknown', no destructor found.
[2018-06-01 22:23:16.836251] (ad/snoodev) ZNC -> CLI [:*test!znc@znc.in PRIVMSG ad :(<Swig Object of type 'unknown' at 0x7f0f051c0540>, <Swig Object of type 'unknown' at 0x7f0f051c00c0>)]
I was asked in #znc on freenode to add some further information: ```python3 import znc class test(znc.Module): description = "example case for bug report" module_types = [znc.CModInfo.NetworkModule] def OnUserRawMessage(self, msg): self.PutModule(str(msg.GetParams())) ``` above is a working test case for this bug, it will PM a response from `*test` on any raw message passed through znc, the PM will contain something like: `(<Swig Object of type 'unknown' at 0x7f0f051c0540>, <Swig Object of type 'unknown' at 0x7f0f051c00c0>)` Also not noted in my bug report is the fact that there are swig warnings in the debug log when this occurs: ``` [2018-06-01 22:23:13.463902] (ad/snoodev) CLI -> ZNC [znc loadmod test] [2018-06-01 22:23:13.465286] (ad/snoodev) ZNC -> CLI [:*status!znc@znc.in PRIVMSG ad :Loaded module test: [./modules/test.py]] [2018-06-01 22:23:16.835922] (ad/snoodev) CLI -> ZNC [PRIVMSG *status :dasdasd] swig/python detected a memory leak of type 'unknown', no destructor found. swig/python detected a memory leak of type 'unknown', no destructor found. [2018-06-01 22:23:16.836251] (ad/snoodev) ZNC -> CLI [:*test!znc@znc.in PRIVMSG ad :(<Swig Object of type 'unknown' at 0x7f0f051c0540>, <Swig Object of type 'unknown' at 0x7f0f051c00c0>)] ``` <!-- github-comment-id:393999703 -->
Author
Owner

Fixed in 11fb428878

Fixed in 11fb42887871a6196dcdf7f7c5556f1e673aceb6 <!-- github-comment-id:394039251 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#843