diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-11 18:37:05 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-11 18:37:05 (GMT) |
commit | 1e50a9f7cc68aefdf94ad02bc3e62fee2f447208 (patch) | |
tree | 32b95ad67a4f2b5f4aa659cf18e617b95a8240aa | |
parent | 9264ecd799eac87c160dcac47d782b092f09d747 (diff) | |
download | cpython-1e50a9f7cc68aefdf94ad02bc3e62fee2f447208.zip cpython-1e50a9f7cc68aefdf94ad02bc3e62fee2f447208.tar.gz cpython-1e50a9f7cc68aefdf94ad02bc3e62fee2f447208.tar.bz2 |
Fix test_wsgiref that used StringIO and a BufferedReader rather than
real files. This code assumed that fileno() would succeed which wasn't
the case.
-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: |