fixed python 3 socket issues which were failing tests