Hi Angus, Thanks for spotting that. This bug slipped through as we don't have a suitable WMS server to test authentication against. I suppose I could set one up, but do you have one available I could use? (let me know offline if you don't want it made public).
Thanks also for your other message (about error handling and capabilities). I have been away recently but will try and make time to put these changes in the trunk soon. Regards Dominic -----Original Message----- From: [email protected] on behalf of Angus Dickey Sent: Sun 07/03/2010 19:55 To: [email protected] Subject: [Community] WMS with Auth fails (Revision: 1566) Hi, Using OWSLib with authentication fails on the latest build. I noticed that the code to do Basic HTTP authentication was recently moved to util.py from wms.py. It looks like when this happened a few old variable names came along for the ride, specifically the section: if username and password: # Provide login information in order to use the WMS server # Create an OpenerDirector with support for Basic HTTP # Authentication... passman = HTTPPasswordMgrWithDefaultRealm() passman.add_password(None, self.url, self.username, self.password) auth_handler = HTTPBasicAuthHandler(passman) opener = build_opener(auth_handler) openit = opener.open else: openit = urlopen should probably be: if username and password: # Provide login information in order to use the WMS server # Create an OpenerDirector with support for Basic HTTP # Authentication... passman = HTTPPasswordMgrWithDefaultRealm() passman.add_password(None, url_base, username, password) auth_handler = HTTPBasicAuthHandler(passman) opener = urllib2.build_opener(auth_handler) openit = opener.open else: openit = urlopen Anyway this seems to fix the problem (I have attached the util.py file). Does this make sense? I could be missing something... Thanks, Angus __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ -- Scanned by iCritical. _______________________________________________ Community mailing list [email protected] http://lists.gispython.org/mailman/listinfo/community
