Backport two additional files from Python3