[Twisted-Python] msg() wrapping in t.words.protocols.irc

Jonathan Lange jml at mumak.net
Thu Jan 6 19:13:29 EST 2005


I just committed code that fixed issue827. I think I also fixed another bug in the wrapping, but I'm not certain.

Here's the story. msg() split the privmsg text into chunks the size of (max_octets_per_line - len(fmt) - 2); fmt = 'PRIVMSG username :%s'. This means that ignoring line endings, each line sent will be at least 4 characters shorter than max_octets_per_line -- 2 for '%s', 2 for the '-2'. I don't know why the '- 2' was there.

In my commit, I took the '%s' into account, and still subtract 2 from the message chunk size. This means that the (undocumented) behaviour has changed. 

I don't really know the IRC protocol, so I don't know what line endings are sent, or whether they are relevant in the protocol API. If someone will enlighten me, I will correct code, docstrings, tests and comments accordingly.


More information about the Twisted-Python mailing list