Replace file with open, which is Python 3 compatible

Change-Id: I471ae9b372f88a508d4654b1a18c6da90397a828
Merge "Replace file with open, which is Python 3 compatible"