bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)

36 files changed