Author: neal.norwitz
Date: Sat Aug 11 20:37:05 2007
New Revision: 56932

Modified:
   python/branches/py3k/Lib/io.py
Log:
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.


Modified: python/branches/py3k/Lib/io.py
==============================================================================
--- python/branches/py3k/Lib/io.py      (original)
+++ python/branches/py3k/Lib/io.py      Sat Aug 11 20:37:05 2007
@@ -34,6 +34,7 @@
 import sys
 import codecs
 import _fileio
+import io
 import warnings
 
 # XXX Shouldn't we use st_blksize whenever we can?
@@ -973,7 +974,7 @@
         if encoding is None:
             try:
                 encoding = os.device_encoding(buffer.fileno())
-            except AttributeError:
+            except (AttributeError, io.UnsupportedOperation):
                 pass
             if encoding is None:
                 try:
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to