[twill] add_auth

Lars Stavholm stava at telcotec.se
Wed Sep 20 01:20:04 PDT 2006

Titus Brown wrote:
> On Tue, Sep 19, 2006 at 08:04:55PM +0100, John J Lee wrote:
> -> [...]
> -> > (um, what the above paragraph means is: always use mechanize.Blah, not
> -> > urllib2.Blah :-)
> -> [...]
> -> 
> -> Just noticed this, also from mechanize page, but says it more clearly:
> -> 
> -> 
> -> mechanize exports the complete interface of urllib2:
> -> 
> -> import mechanize
> -> response = mechanize.urlopen("http://www.example.com/")
> -> print response.read()
> -> 
> -> so anything you would normally import from urllib2 can (and should, by 
> -> preference, to insulate you from future changes) be imported from 
> -> mechanize instead. In many cases if you import an object from mechanize it 
> -> will be the very same object you would get if you imported from urllib2. 
> -> In many other cases, though, the implementation comes from mechanize, 
> -> either because bug fixes have been applied or the functionality of urllib2 
> -> has been extended in some way.
> OK, I've swapped out all references to urllib2.
> Stava, if you download 
> 	http://darcs.idyll.org/~t/projects/twill-latest.tar.gz
> the auth stuff now uses mechanize's auth handling.  It's still two
> months behind John's latest mechanize (because I still have some custom
> stuff that hasn't been integrated into mechanize) but it might work.

OK, I did, sorry to say: things took a turn for the worst: more errors.

I've attached two log files, one using stock twill-0.8.5,
and the other using twill-latest:

o twill-0.8.5:  the login error we started out with.
o twill-latest: a good few more link errors in addition
                to the login failing.

At the beginning of each log you'll have the twill input I'm using.
You're welcome to try it out yourself. <http://www.linadd.org> is
a public site with low traffic. I've added user "test" with password
"moretest" that I use for these tests.


More information about the twill mailing list