From 23968baf497bf119614f1a34e9af1599723f1c6a Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 25 Nov 2003 22:52:04 +0000 Subject: [PATCH] Fix bug #849302. --- src/Owner.py | 5 +++++ test/test_callbacks.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/Owner.py b/src/Owner.py index 04f508341..fd44f4df9 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -123,6 +123,11 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): if s: try: tokens = callbacks.tokenize(s) + if tokens and isinstance(tokens[0], list): + s = 'The command called may not be the result ' \ + 'of a nested command.' + irc.queueMsg(callbacks.error(msg, s)) + return except SyntaxError, e: irc.queueMsg(callbacks.error(msg, str(e))) return diff --git a/test/test_callbacks.py b/test/test_callbacks.py index 4f9998a3d..195666788 100644 --- a/test/test_callbacks.py +++ b/test/test_callbacks.py @@ -320,6 +320,9 @@ class PrivmsgTestCase(ChannelPluginTestCase): self.assertError('load [foo') self.assertError('load foo]') + def testNoEscapingAttributeErrorFromTokenizeWithFirstElementList(self): + self.assertError('[plugin list] list') + class PrivmsgCommandAndRegexpTestCase(PluginTestCase): plugins = ('Utilities',) # Gotta put something.