diff options
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 0f33ed5..380a7a7 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -2021,14 +2021,6 @@ class TextIOWrapper(TextIOBase): self._check_newline(newline) encoding = text_encoding(encoding) - if encoding == "locale" and sys.platform == "win32": - # On Unix, os.device_encoding() returns "utf-8" instead of locale encoding - # in the UTF-8 mode. So we use os.device_encoding() only on Windows. - try: - encoding = os.device_encoding(buffer.fileno()) or "locale" - except (AttributeError, UnsupportedOperation): - pass - if encoding == "locale": try: import locale |