Ported to python 3.1.

--HG--
branch : python3
Merged with python3
Tests use pytest-localhost 0.3 from now on. This should fix failing Jenkins tests.
Automated merge.