[Python-3000-checkins] r64384 - python/branches/py3k-urllib/Lib/urllib/request.py

senthil.kumaran python-3000-checkins at python.org
Wed Jun 18 21:53:05 CEST 2008


Author: senthil.kumaran
Date: Wed Jun 18 21:53:05 2008
New Revision: 64384

Log:
Fix the test_redirect and cookie_redirect. Headers are plain dicts

Modified:
   python/branches/py3k-urllib/Lib/urllib/request.py

Modified: python/branches/py3k-urllib/Lib/urllib/request.py
==============================================================================
--- python/branches/py3k-urllib/Lib/urllib/request.py	(original)
+++ python/branches/py3k-urllib/Lib/urllib/request.py	Wed Jun 18 21:53:05 2008
@@ -526,9 +526,9 @@
         # Some servers (incorrectly) return multiple Location headers
         # (so probably same goes for URI).  Use first header.
         if "location" in headers:
-            newurl = headers["location"][0]
+            newurl = headers["location"]
         elif "uri" in headers:
-            newurl = headers["uri"][0]
+            newurl = headers["uri"]
         else:
             return
         newurl = urllib.parse.urljoin(req.get_full_url(), newurl)


More information about the Python-3000-checkins mailing list