Index: Lib/urllib/response.py =================================================================== --- Lib/urllib/response.py (revision 68176) +++ Lib/urllib/response.py (working copy) @@ -31,6 +31,15 @@ return '<%s at %r whose fp = %r>' % (self.__class__.__name__, id(self), self.fp) + def __iter__(self): + return self + + def __next__(self): + line = self.readline() + if not line: + raise StopIteration + return line + def close(self): self.read = None self.readline = None