fixing os.chmod() call for python23 compatibility