Hack so that if a 302 or 301 redirect contains a relative URL, the
right thing "just happens" (basejoin() with old URL).
diff --git a/Lib/urllib.py b/Lib/urllib.py
index c3da7bf..9ccf9c5 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -451,6 +451,8 @@
             return
         void = fp.read()
         fp.close()
+        # In case the server sent a relative URL, join with original:
+        newurl = basejoin("http:" + url, newurl)
         return self.open(newurl, data)
 
     # Error 301 -- also relocated (permanently)