]> git.phdru.name Git - bookmarks_db.git/commitdiff
fp could be None in http_error_default().
authorOleg Broytman <phd@phdru.name>
Sun, 10 Feb 2008 21:49:40 +0000 (21:49 +0000)
committerOleg Broytman <phd@phdru.name>
Sun, 10 Feb 2008 21:49:40 +0000 (21:49 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@163 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/bkmk_rsimple.py

index 6f65b2203960d12ec397e2736770dbb32770a5e5..2d5ec8fb0d796ca17bca430cf41ef79aafaf276f 100644 (file)
@@ -45,6 +45,12 @@ class MyURLopener(urllib.URLopener):
    def http_error_401(self, url, fp, errcode, errmsg, headers, data=None): 
       raise IOError, ('http error', errcode, "Authentication required ", headers)
 
+   def http_error_default(self, url, fp, errcode, errmsg, headers):
+      if fp:
+         void = fp.read()
+         fp.close()
+      raise IOError, ('http error', errcode, errmsg, headers)
+
 
 urllib._urlopener = MyURLopener()