set client and server compatibility between python 2 and 3