Commit 1e50a9f7 authored by Neal Norwitz's avatar Neal Norwitz

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.
parent 9264ecd7
...@@ -34,6 +34,7 @@ import os ...@@ -34,6 +34,7 @@ import os
import sys import sys
import codecs import codecs
import _fileio import _fileio
import io
import warnings import warnings
# XXX Shouldn't we use st_blksize whenever we can? # XXX Shouldn't we use st_blksize whenever we can?
...@@ -973,7 +974,7 @@ class TextIOWrapper(TextIOBase): ...@@ -973,7 +974,7 @@ class TextIOWrapper(TextIOBase):
if encoding is None: if encoding is None:
try: try:
encoding = os.device_encoding(buffer.fileno()) encoding = os.device_encoding(buffer.fileno())
except AttributeError: except (AttributeError, io.UnsupportedOperation):
pass pass
if encoding is None: if encoding is None:
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment