On Wed, Jul 27, 2011 at 11:52:32AM +0200, Antoine Pitrou wrote: > > + > > + try: > > + with urllib.request.urlopen('http://www.imdb.com') as res: > > + pass > > Can you please at least use support.transient_internet() as in other > tests in this file?
It was intentional because ValueError was raised from context manager use case for a bug where the request object was closed prematurely. support.transient_internet, I believe would not have covered that case (Usage scenario). > > + req = urllib.request.urlopen('http://www.imdb.com') > > Why a second time? When used outside of context manager, it gave empty response instead of ValueError and the test case was to check that. > > + res = req.read() > > + self.assertTrue(res) > > Also, when does "req" get closed? Right now I get resource warnings: I shall fix this one. I think, attempting to fix the Resource warning caused the regression wherein the request object closed prematurely. I shall look at this. Thanks, Senthil _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com