getting same single test fail for manual parsing code in python 2 and 3