fixes for python-2.5 and twisted-10.0.0 compatibility