Compatibility with Python 3

Hi,

In the Debian package which I am about to upload, I'm embedding these 2 patches. It'd be nice to address the issue. I don't mind if you find another solution (especially for the test I disabled), but I would appreciate reactiveness. Best would be if you could get a new version out on PyPi ASAP with these fixes.