diff options
Diffstat (limited to 'Lib/io.py')
-rw-r--r-- | Lib/io.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -34,6 +34,7 @@ import os import sys import codecs import _fileio +import io import warnings # XXX Shouldn't we use st_blksize whenever we can? @@ -973,7 +974,7 @@ class TextIOWrapper(TextIOBase): if encoding is None: try: encoding = os.device_encoding(buffer.fileno()) - except AttributeError: + except (AttributeError, io.UnsupportedOperation): pass if encoding is None: try: |