Message389822
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"`. |
|
Date |
User |
Action |
Args |
2021-03-30 12:07:35 | methane | set | recipients:
+ methane, vstinner |
2021-03-30 12:07:35 | methane | set | messageid: <1617106055.65.0.114999374922.issue43510@roundup.psfhosted.org> |
2021-03-30 12:07:35 | methane | link | issue43510 messages |
2021-03-30 12:07:35 | methane | create | |
|