As described above the server does not return the client nickname as part of its
error reply ERR_NOTONCHANNEL in the topic_handler() function.
This violates RFC2812, which states:
"The most common reply is the numeric reply, used for both
errors and normal replies. The numeric reply MUST be sent as one
message consisting of the sender prefix, the three-digit numeric, and
the target of the reply." - RFC2812, p.8
A short fix would be to change the reply to:
self.reply(b"442 %s %s :You're not on that channel" % (self.nickname, channelname))