[issue32723] codecs.open silently ignores argument errors

Josh Rosenberg report at bugs.python.org
Tue Jan 30 19:41:20 EST 2018


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

Ah, my mistake. That said, when you're not passing an encoding, you're still just calling regular open, it's not doing any special codecs.open wrapping (on Python 2, this meant you weren't decoding the input at all, on Python 3 it means you're decoding with the default encoding); you may as well just call open (codecs.open is pointless as soon as io.open exists, since codecs.open it's slower and has so many weird quirks).

While I acknowledge codecs.open is misbehaving here, I'm not sure fixing it is a great idea, since the function is effectively a legacy function (especially when used without an encoding argument), and io.open works correctly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32723>
_______________________________________


More information about the Python-bugs-list mailing list