]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/bkmk_rurllib_py3.py
Feat(robots): Align "Content-Type"
[bookmarks_db.git] / Robots / bkmk_rurllib_py3.py
index 1da8ec879e96925e40a8ab9cb9fe2e54407ffb7c..1daec389aebaa27f3eb502cc2ef2016310dbea4c 100644 (file)
@@ -11,6 +11,7 @@ __license__ = "GNU GPL"
 __all__ = ['robot_urllib_py3']
 
 
+import http.client
 import socket
 import sys
 import urllib.request
@@ -42,6 +43,8 @@ class MyURLopener(urllib.request.URLopener):
     http_error_303 = http_error_301
     # Error 307 -- relocated (temporarily)
     http_error_307 = http_error_301
+    # Error 308 -- relocated (permanently)
+    http_error_308 = http_error_301
 
     # Error 401 -- authentication required
     def http_error_401(self, url, fp, errcode, errmsg, headers, data=None):
@@ -136,7 +139,7 @@ class robot_urllib_py3(robot_base):
         except RedirectException as e:
             return None, e.errcode, e.newurl, None, None
 
-        except OSError as e:
+        except (OSError, http.client.IncompleteRead) as e:
             error = str(e)
             self.log('   Error: %s' % error)
             return error, None, None, None, None