diff --git a/scripts/supybot-wizard b/scripts/supybot-wizard index dc39530c4..56972ce20 100755 --- a/scripts/supybot-wizard +++ b/scripts/supybot-wizard @@ -383,7 +383,8 @@ def main(): # FIXME: say which ones weren't channels. output("""Not all of those are valid IRC channels. Be sure to prefix the channel with # (or +, or !, or &, but no one uses - those channels, really).""") + those channels, really). Be sure the channel key (if you are + supplying one) does not contain a comma.""") else: conf.supybot.channels.setValue([]) diff --git a/src/conf.py b/src/conf.py index 06a3c1881..1bad0f677 100644 --- a/src/conf.py +++ b/src/conf.py @@ -168,7 +168,13 @@ class ValidChannel(registry.String): """Value must be a valid IRC channel name.""" def setValue(self, v): if ',' in v: - (channel, _) = v.split(',', 1) + # To prevent stupid users from: a) trying to add a channel key + # with a comma in it, b) trying to add channels separated by + # commas instead of spaces + try: + (channel, _) = v.split(',') + except ValueError: + self.error() else: channel = v if not ircutils.isChannel(channel):