using HTTP Digest auth with arbitrary HTTP methods?

John Reese jtr at
Mon Jan 3 18:56:31 EST 2005

On 03 Jan 2005 18:11:06 +0000, John J. Lee <jjl at> wrote:
> (Re ternary operator: Everybody who read this list at certain times in
> the past is painfully aware of that fact, and of precisely why it's
> not quite true, and of all the syntax alternatives for real ternary
> conditionals that will never be part of Python ;-)

Yeah, I ran across the PEP after I posted this.  Sorry to bring up a
sore subject....

> Nobody is really in charge: just go ahead and submit a patch.  Drop me
> an email when you do, and I'll try to review it.  The only reason
> urllib2 doesn't already do arbitrary HTTP methods is that nobody has
> spent the time to think carefully if a .set_method() really is the
> right way to do it, then followed through with the work needed to get
> a patch applied.

Patch id #1095362 on Sourceforge.  It turns out one of the bugs had
already been fixed in CVS -- the digest bug was the only one left, so
this is a one-line fix.

> As always, a precondition for change is that somebody thinks something
> through carefully, writes tests, documentation, patch and submits all
> three to the SF patch tracker with a brief explanation like the one
> you give above.
> BTW, Greg Stein started work on adding the stuff you need at the
> httplib level (as module httpx).  He seems too busy to finish it, but
> see modules httpx and davlib (one or both are in the Python CVS
> sandbox).  He thinks httplib is a better place for DAV than urllib2,
> and he should know.  But go ahead and fix urllib2 anyway... :-)

These files are 2 and 3 years old.  He's probably right that an
interface more like httplib would be more appropriate for a DAV client;
urllib2 is more about generalizing open() to use URLs than fully
exposing the protocol.  But urllib2 does have all those convenient
handler-chains, and a good DAV client needs to handle a lot of those
same situations, so it might be a good idea to at least find a way to
share the handler classes.

More information about the Python-list mailing list