Fixed file io for build script in python 3