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.
This commit is contained in:
Neal Norwitz 2007-08-11 18:37:05 +00:00
parent 9264ecd799
commit 1e50a9f7cc
1 changed files with 2 additions and 1 deletions

View File

@ -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: