mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-91952: Make TextIOWrapper.reconfigure() supports "locale" encoding (GH-91982)
This commit is contained in:
parent
b9636180b3
commit
0729b31a8b
4 changed files with 16 additions and 2 deletions
|
@ -2161,6 +2161,8 @@ class TextIOWrapper(TextIOBase):
|
|||
else:
|
||||
if not isinstance(encoding, str):
|
||||
raise TypeError("invalid encoding: %r" % encoding)
|
||||
if encoding == "locale":
|
||||
encoding = locale.getencoding()
|
||||
|
||||
if newline is Ellipsis:
|
||||
newline = self._readnl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue