modernize some modules' code by using with statement around open()
14 files changed