Fixed request processing in python 3.X