diff --git a/.travis.yml b/.travis.yml index 9d49d6220..ef09dd497 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ install: script: - echo $TRAVIS_PYTHON_VERSION - python setup.py install - - supybot-test test --plugins-dir=./build/lib/supybot/plugins/ --no-network --disable-multiprocessing + - supybot-test test --plugins-dir=./build/lib*/supybot/plugins/ --no-network --disable-multiprocessing diff --git a/README.md b/README.md index c1683171d..b2c175c3f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[http://supybot.fr.cr/doc/use/install.html](Install guide) +[Install guide](http://supybot.fr.cr/doc/use/install.html) # Build status diff --git a/plugins/Alias/test.py b/plugins/Alias/test.py index a68829980..c13b2e03a 100644 --- a/plugins/Alias/test.py +++ b/plugins/Alias/test.py @@ -1,3 +1,4 @@ +# -*- coding: utf8 -*- ### # Copyright (c) 2002-2004, Jeremiah Fincher # All rights reserved. diff --git a/plugins/Karma/plugin.py b/plugins/Karma/plugin.py index 10862e978..2da7575dc 100644 --- a/plugins/Karma/plugin.py +++ b/plugins/Karma/plugin.py @@ -262,7 +262,7 @@ class Karma(callbacks.Plugin): def invalidCommand(self, irc, msg, tokens): channel = msg.args[0] - if not irc.isChannel(channel): + if not irc.isChannel(channel) or not tokens: return if tokens[-1][-2:] in ('++', '--'): thing = ' '.join(tokens) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 99186ff25..d161b0103 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -88,6 +88,7 @@ class Misc(callbacks.Plugin): def invalidCommand(self, irc, msg, tokens): assert not msg.repliedTo, 'repliedTo msg in Misc.invalidCommand.' assert self is irc.callbacks[-1], 'Misc isn\'t last callback.' + assert msg.command in ('PRIVMSG', 'NOTICE') self.log.debug('Misc.invalidCommand called (tokens %s)', tokens) # First, we check for invalidCommand floods. This is rightfully done # here since this will be the last invalidCommand called, and thus it @@ -125,7 +126,9 @@ class Misc(callbacks.Plugin): banmasker = conf.supybot.protocols.irc.banmask.makeBanmask self.invalidCommands.enqueue(msg) if self.invalidCommands.len(msg) > maximum and \ - not ircdb.checkCapability(msg.prefix, 'owner'): + not ircdb.checkCapability(msg.prefix, 'owner') and \ + msg.prefix != irc.prefix and \ + ircutils.isUserHostmask(msg.prefix): penalty = conf.supybot.abuse.flood.command.invalid.punishment() banmask = banmasker(msg.prefix, channel=None) self.log.info('Ignoring %s for %s seconds due to an apparent ' diff --git a/plugins/Services/plugin.py b/plugins/Services/plugin.py index 12a13b82a..053134265 100644 --- a/plugins/Services/plugin.py +++ b/plugins/Services/plugin.py @@ -264,6 +264,10 @@ class Services(callbacks.Plugin): on) elif 'inviting' in s: self.log.debug('Got "Inviting to channel" from ChanServ %s.', on) + elif s.startswith('['): + chanTypes = irc.state.supported['CHANTYPES'] + if re.match(r'^\[[%s]' % re.escape(chanTypes), s): + self.log.debug('Got entrymsg from ChanServ %s.', on) else: self.log.warning('Got unexpected notice from ChanServ %s: %r.', on, msg) diff --git a/scripts/supybot-botchk b/scripts/supybot-botchk index 9d406da3d..430ac33b5 100644 --- a/scripts/supybot-botchk +++ b/scripts/supybot-botchk @@ -129,7 +129,8 @@ if __name__ == '__main__': filename = os.path.join(home, filename) if os.path.exists(filename): debug('Found %s, sourcing.' % filename) - inst.stdin.write('source %s' % filename + os.linesep) + command = 'source %s' % filename + os.linesep + inst.stdin.write(command.encode('utf-8')) cmdline = '%s --daemon %s' % (options.supybot, options.conffile) debug('Sending cmdline to sh process.') inst.stdin.write(cmdline.encode('utf-8') + os.linesep.encode('utf-8')) diff --git a/src/irclib.py b/src/irclib.py index a8e1f1e78..dfb73022b 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -910,6 +910,7 @@ class Irc(IrcCommandDispatcher): self.lastTake = 0 self.server = 'unset' self.afterConnect = False + self.startedAt = time.time() self.lastping = time.time() self.outstandingPing = False diff --git a/src/utils/web.py b/src/utils/web.py index b51da9679..51326f8c7 100644 --- a/src/utils/web.py +++ b/src/utils/web.py @@ -117,8 +117,13 @@ def getUrlFd(url, headers=None, data=None): url = scheme + '://' + url request = urllib2.Request(url, headers=headers, data=data) if 'auth' in locals(): + if sys.version_info[0] >= 3 and isinstance(auth, str): + auth = auth.encode() + auth = base64.b64encode(auth) + if sys.version_info[0] >= 3: + auth = auth.decode() request.add_header('Authorization', - 'Basic ' + base64.b64encode(auth)) + 'Basic ' + auth) else: request = url request.add_data(data) @@ -212,3 +217,4 @@ def mungeEmail(s): # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: +