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. |