Inada Naoki <[email protected]> added the comment:
In bpo-43651, I found code pattern that it's difficult to use
io.text_encoding():
class OpenWrapper:
def __new__(cls, *args, **kwargs):
return open(*args, **kwargs)
`kwargs["encoding"] = text_encoding(kwargs.get("encoding)` doesn't work because
`open(filename, "b", encoding="locale")` raises `ValueError: binary mode
doesn't take an encoding argument`.
I think we should accept `encoding="locale"` even in binary mode. It makes easy
to use `text_encoding()` and `encoding="locale"`.
----------
resolution: fixed ->
status: closed -> open
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43510>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com