Index: Lib/test/test_urllib2net.py =================================================================== --- Lib/test/test_urllib2net.py (revision 69418) +++ Lib/test/test_urllib2net.py (working copy) @@ -91,6 +91,21 @@ response.close() self.assert_(fileobject.closed) + +class Test_AddInfoURL(unittest.TestCase): + + def test_fileno(self): + request = urllib2.Request("http://pheared.net") + opener = urllib2.build_opener() + r = opener.open(request) + try: + r.fileno() + except AttributeError: + self.fail('addinfourl.fileno() should work with HTTPResponse') + finally: + r.close() + + class OtherNetworkTests(unittest.TestCase): def setUp(self): if 0: # for debugging Index: Lib/urllib.py =================================================================== --- Lib/urllib.py (revision 69418) +++ Lib/urllib.py (working copy) @@ -980,7 +980,15 @@ def geturl(self): return self.url + @property + def fileno(self): + return self.fp.fileno + @fileno.setter + def fileno(self, value): + self.fp.fileno = value + + # Utilities to parse URLs (most of these return None for missing parts): # unwrap('') --> 'type://host/path' # splittype('type:opaquestring') --> 'type', 'opaquestring'