Py3k compatibility

Note that Python 3.3 also needs the following pull request for Pyramid:

  https://github.com/Pylons/pyramid/pull/1015