Maybe explicitly open this for reading using 'r' as a second parameter?