Ticket #3978: bug_3978.patch

File bug_3978.patch, 1.6 KB (added by Upasana Shukla, 8 years ago)
  • twisted/words/test/test_irc.py

     
    10241024
    10251025
    10261026    def test_ERRMSG(self):
    1027         """Testing CTCP query ERRMSG.
     1027        """
     1028        Testing CTCP query ERRMSG.
    10281029
    10291030        Not because this is this is an especially important case in the
    10301031        field, but it does go through the entire dispatch/decode/encode
     
    21792180        action = 'waves'
    21802181        self.protocol.describe(target, action)
    21812182        self.protocol.describe(channel, action)
     2183        self.protocol.describe(channel, r'\o/')
    21822184        expected = [
    21832185            'PRIVMSG %s :\01ACTION %s\01' % (target, action),
    21842186            'PRIVMSG %s :\01ACTION %s\01' % (channel, action),
     2187            'PRIVMSG %s :\01ACTION %s\01' % (channel, r'\o/'),
    21852188            '']
    21862189        self.assertEqual(self.transport.value().split('\r\n'), expected)
    21872190
  • twisted/words/protocols/irc.py

     
    34003400
    34013401xQuoteTable = {
    34023402    X_DELIM: X_QUOTE + 'a',
    3403     X_QUOTE: X_QUOTE + X_QUOTE
     3403    # X_QUOTE: X_QUOTE + X_QUOTE
    34043404    }
    34053405
    34063406xDequoteTable = {}
     
    34113411xEscape_re = re.compile('%s.' % (re.escape(X_QUOTE),), re.DOTALL)
    34123412
    34133413def ctcpQuote(s):
    3414     for c in (X_QUOTE, X_DELIM):
     3414    for c in xQuoteTable:
    34153415        s = string.replace(s, c, xQuoteTable[c])
    34163416    return s
    34173417