replace file(...) with open(...)