Workaround for urllib2 not doing basic auth URLs. (This is broken
authorAdam Sampson <ats@offog.org>
Sat, 11 Oct 2003 15:59:02 +0000 (15:59 +0000)
committerAdam Sampson <ats@offog.org>
Sat, 11 Oct 2003 15:59:02 +0000 (15:59 +0000)
because you end up with the passwords in the feeds list!)

rawdoglib/rawdog.py

index a152429c9ff9d19f43faf88dd8109aac0260055e..32a7e95d267787dd2b06b1fc1e56d72ba595dad5 100644 (file)
@@ -78,7 +78,14 @@ class Feed:
                        return 0
 
                try:
-                       p = feedparser.parse(self.url, self.etag,
+                       # Kludge for inadequate authentication support in
+                       # urllib2.
+                       u = self.url
+                       if u.startswith("https:"):
+                               import urllib
+                               u = urllib.urlopen(u)
+
+                       p = feedparser.parse(u, self.etag,
                                self.modified,  "rawdog/" + VERSION)
                        status = p.get("status")
                except: