Python : File permission manipulation