Basic url encoding in python using sockets.