From 700bd926778b06bfd955ace944b863c722b40872 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 27 Aug 2007 18:10:06 +0000 Subject: [PATCH] Fix a few places that broke due to a recent change to io.py. --- Lib/test/test_urllib2.py | 2 +- Lib/urllib2.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index dff840ecc03..22979f69476 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -673,7 +673,7 @@ class HandlerTests(unittest.TestCase): 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 diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 658bc3dc7aa..1defbe93b5d 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -1079,6 +1079,8 @@ class AbstractHTTPHandler(BaseHandler): # 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())