[Python-3000-checkins] r57565 - in python/branches/py3k/Lib: test/test_urllib2.py urllib2.py

guido.van.rossum python-3000-checkins at python.org
Mon Aug 27 20:10:06 CEST 2007


Author: guido.van.rossum
Date: Mon Aug 27 20:10:06 2007
New Revision: 57565

Modified:
   python/branches/py3k/Lib/test/test_urllib2.py
   python/branches/py3k/Lib/urllib2.py
Log:
Fix a few places that broke due to a recent change to io.py.


Modified: python/branches/py3k/Lib/test/test_urllib2.py
==============================================================================
--- python/branches/py3k/Lib/test/test_urllib2.py	(original)
+++ python/branches/py3k/Lib/test/test_urllib2.py	Mon Aug 27 20:10:06 2007
@@ -673,7 +673,7 @@
                 self.assertEqual(req.type, "ftp")
 
     def test_http(self):
-        class MockHTTPResponse:
+        class MockHTTPResponse(io.IOBase):
             def __init__(self, fp, msg, status, reason):
                 self.fp = fp
                 self.msg = msg

Modified: python/branches/py3k/Lib/urllib2.py
==============================================================================
--- python/branches/py3k/Lib/urllib2.py	(original)
+++ python/branches/py3k/Lib/urllib2.py	Mon Aug 27 20:10:06 2007
@@ -1079,6 +1079,8 @@
         # Add some fake methods to the reader to satisfy BufferedReader.
         r.readable = lambda: True
         r.writable = r.seekable = lambda: False
+        r._checkReadable = lambda: True
+        r._checkWritable = lambda: False
         fp = io.BufferedReader(r)
 
         resp = addinfourl(fp, r.msg, req.get_full_url())


More information about the Python-3000-checkins mailing list