Message389822
| Author |
methane |
| Recipients |
methane, vstinner |
| Date |
2021年03月30日.12:07:35 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1617106055.65.0.114999374922.issue43510@roundup.psfhosted.org> |
| In-reply-to |
| Content |
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"`. |
|
History
|
|---|
| 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 |
|