Browse Source

Switch to Python3

Our servers have, in the two years since we last needed to change
statusbot, switched to installing packages with pip for Python 3.x
instead of 2.7. Instead of figuring out how to unfurl that, just
roll forward and embrace the glorious pastfuture.

Update the simplemediawiki version to pull in a prerelease, since
that's the only way to get a version which supports Py3K.

Change-Id: I24100ad2e9d87e20b7fd9ce90399346846529985
changes/70/793670/1
Jeremy Stanley 2 months ago
parent
commit
e8f9ee6e45
  1. 2
      requirements.txt
  2. 4
      setup.cfg
  3. 6
      statusbot/bot.py

2
requirements.txt

@ -1,6 +1,6 @@
six>=1.7.0
simplemediawiki
simplemediawiki>=1.2.0b2
irc
python-daemon
kitchen

4
setup.cfg

@ -12,8 +12,8 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
[entry_points]
console_scripts =

6
statusbot/bot.py

@ -47,7 +47,7 @@ access_token_secret=access_token_secret
"""
import argparse
import ConfigParser
import configparser
import daemon
from ib3.auth import SASL
from ib3.connection import SSL
@ -302,7 +302,7 @@ class AlertFile(UpdateInterface):
if not self.path:
return
f, path = tempfile.mkstemp(dir=self.dir)
os.write(f, json.dumps(dict(alert=msg)))
os.write(f, json.dumps(dict(alert=msg)).encode('utf-8'))
os.close(f)
os.chmod(path, 0o644)
os.rename(path, self.path)
@ -491,7 +491,7 @@ class SASLStatusBot(SASL, BaseStatusBot):
def _main(configpath):
config = ConfigParser.RawConfigParser()
config = configparser.RawConfigParser()
config.read(configpath)
setup_logging(config)

Loading…
Cancel
Save