Inada Naoki <songofaca...@gmail.com> added the comment:

I'm sorry, I was wrong. Allowing `encoding="locale"` didn't help OpenWrapper. 
See GH-25107.

If we use `encoding = text_encoding(encoding)` in binary mode, `open(filename, 
"rb")` will be warned. This doesn't make sense at all.

Adding `mode` parameter to the `text_encoding()` doesn't make sense too. 
Because it is used for functions wrapping not only open(), but also 
TextIOWrapper().

So we must not call `text_encoding()` in binary mode. Allowing 
`encoding="locale"` in binary mode doesn't make it easy. I will revert GH-25103.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43510>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to