Re: urllib and sites that require passwds

2004-12-23 Thread Fuzzyman
Ishwor wrote: > On 23 Dec 2004 06:46:50 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > > damn... I'm losing my leading spaces indentation should be obvious > We'll forgive you for that. It was from "top-of-your-head" ~;-) > Hey - I put the indentation in there... it just got stripped out when i

Re: urllib and sites that require passwds

2004-12-23 Thread Ishwor
On 23 Dec 2004 06:46:50 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > damn... I'm losing my leading spaces indentation should be obvious We'll forgive you for that. It was from "top-of-your-head" ~;-) > anyway... (everything below except is indented at least one step). > Fuzzy Its nice that url

Re: urllib and sites that require passwds

2004-12-23 Thread Fuzzyman
damn... I'm losing my leading spaces indentation should be obvious anyway... (everything below except is indented at least one step). Fuzzy -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib and sites that require passwds

2004-12-23 Thread Fuzzyman
USe urllib2 which will fail with an exception. You can trap this exception and using the code attribute of the exception object, determine why it failed. The error code for 'authentication required' is 401. Off the top of my head : import urllib2 req = urllib2.Request(theurl) try: handle = urllib