[Patches] [ python-Patches-698520 ] Iterator for urllib.URLOpener

SourceForge.net noreply@sourceforge.net
Fri, 07 Mar 2003 15:17:56 -0800


Patches item #698520, was opened at 2003-03-06 01:37
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=698520&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brett Cannon (bcannon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Iterator for urllib.URLOpener

Initial Comment:
4 line patch to give urllib.URLOpener an iterator.  Follows design of module and adds methods only if the file object used internally has __iter__ and adds 'next' only if __iter__ was added.

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-03-07 18:17

Message:
Logged In: YES 
user_id=80475

That's fine.  Go ahead and load the patch without the 
tests.  Keep it on your todo list.  It would be nice to have 
some good PyUnit tests for this module.

Assign it to me when it's ready and I'll load it.

----------------------------------------------------------------------

Comment By: Brett Cannon (bcannon)
Date: 2003-03-07 16:18

Message:
Logged In: YES 
user_id=357491

The quotes thing was just a slip-up.  t' fixed in my local copy and thus it will show up when I upload another patch.

I will write up patches to the docs, although the docs guarantee certain methods that are actually conditionally added to the object; should I go ahead and just change the docs to reflect this or rip out the conditionality of the adding of the methods since the file object, if using a socket, is coming from socket.makefile() (I think; urllib seems to be from the 1.5 days and thus is using httplib.HTTP() and thus had to read the code)?

I will also come up with a news item to be pasted into Misc/NEWS by the person who checks this in.

As for the test, though, test_urllib only tests quote().  The module itself has some tests that can be run when the module is __main__, but all it does is fetch various pages and print the output; nothing really there that wouldn't be caught from people using it day-to-day.  In other words there is no good place to put a test since there basically are no tests for this part of the module.  =)  Yes, I could fix this, but that would be a completely separate patch since the quote() tests are not even a PyUnit testing suite.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-03-07 01:22

Message:
Logged In: YES 
user_id=80475

Looks good.
Tests out okay.
Use double quotes throughout.
Consider adding a news item, docs, and a test.
Assign back to me when you think it's ready to go. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=698520&group_id=5470