[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

bpo-38971: open file in codecs.open() closes if exception raised by caporta · Pull Request #17666 · python/cpython

the-knights-who-say-ni

The Wayback Machine - https://web.archive.org/web/20191227172241/https://github.com/python/cpython/pull/17666

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up

Conversation

Open issue in the BPO indicated a desire to make the implementation of
codecs.open() at parity with io.open(), which implements a try/except to
assure file stream gets closed before an exception is raised.

- Move spec out of seperate class and into CodecsModuleTest
- Pass invalid encoding to force exception rather than mock
- Specify that a LookupError is raised specifically