On Fri, 24 Apr 2009 04:25:20 -0700 (PDT), Lakshman wrote: > I am trying to authenticate using urllib2. The basic authentication > works if I hard code authheaders. ... > except IOError, e: > print "Something wrong. This shouldnt happen"
First of all, don't shoot yourself in the foot and check what the exceptions are, i.e.: except: import traceback print traceback.format_exc() Second, better use mechanize: http://wwwsearch.sourceforge.net/mechanize/ HTH, -- Regards, Wojtek Walczak, http://tosh.pl/gminick/ -- http://mail.python.org/mailman/listinfo/python-list