[Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

Brett Cannon brett at python.org
Sat Mar 1 21:13:56 CET 2008


On Sat, Mar 1, 2008 at 4:34 AM, M.-A. Lemburg <mal at egenix.com> wrote:
> On 2008-03-01 05:06, Brett Cannon wrote:
>  > Seriously, I just don't want to support two different approaches to
>  > the same problem.
>
>  Then what makes you believe that the urllib2 approach is the
>  better one ?
>
>  Why not move urllib2 to PyPI and keep urllib ?
>

Well, I have personal experience where urllib2 was much easier to use
for some custom fetching than urllib.

But I get your point. If it comes down to preference then your
argument is to choose the one the is used more widely.

>
>  >>  It's not really an argument for dropping the more used module in
>  >>  favor of a different module without any real benefit.
>  >
>  > Benefit to old users, no. Benefit to the developers, definitely.
>  > Benefit to new users, yes as there will be less to deal with.
>
>  Same question as above.
>
>
>  >>  You have to ask yourself whether
>  >>  it's ok to ask the maintainers of those ~1000 code modules
>  >>  using urllib for subclassing from the two main classes
>  >>  URLopener and FancyURLopener to download an external dependency
>  >>  from PyPI or ship the module with their code.
>  >
>  > Well, I obviously think it is.
>
>  Please explain. I have yet to see a single comment explaining why
>  urllib2 would be the better choice - if there's really a need to
>  decide (which I don't think there really is).
>
>  If you can put up some sound arguments for why urllib2 is better
>  than urllib, we could move the discussion forward. If not, then
>  I don't really see any benefit in having the discussion at all.

Well, look at the docs for urllib. There is a list of restrictions
(e.g., does not support the use of proxies which require
authentication). From what I can tell, those items on the list that
are an actual restriction do not carry over to urllib2. Another thing,
how do you add a custom line to the header for the request in urllib
(e.g., Referer)? The docs for URLOpener don't seem to provide a way.
urllib2, on the other hand, has a very specific way to add headers.

But as I said in my last email, I am happy to include URLOpener if
some other people are willing to back the idea up.

-Brett


More information about the Web-SIG mailing list