[py] raise an exception when reading source failed