]> granicus.if.org Git - python/commitdiff
bug #1365984: urllib and data: URLs. Problem was that cStringIO objects cannot be...
authorGeorg Brandl <georg@python.org>
Sat, 26 Nov 2005 16:50:44 +0000 (16:50 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 26 Nov 2005 16:50:44 +0000 (16:50 +0000)
Lib/urllib.py
Misc/NEWS

index f00d02ff9eeefa5b5d003f17fcce983a7c87c505..f700d718f4bc9389f72bbf0f592b9d5901a6a347 100644 (file)
@@ -556,7 +556,7 @@ class URLopener:
         msg = '\n'.join(msg)
         f = StringIO(msg)
         headers = mimetools.Message(f, 0)
-        f.fileno = None     # needed for addinfourl
+        #f.fileno = None     # needed for addinfourl
         return addinfourl(f, headers, url)
 
 
@@ -813,7 +813,10 @@ class addbase:
         self.read = self.fp.read
         self.readline = self.fp.readline
         if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines
-        if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno
+        if hasattr(self.fp, "fileno"):
+            self.fileno = self.fp.fileno
+        else:
+            self.fileno = lambda: None
         if hasattr(self.fp, "__iter__"):
             self.__iter__ = self.fp.__iter__
             if hasattr(self.fp, "next"):
index de637e1f9f20b6ca8fe4c0e1bf94064b5ddbbe91..c087a11e0e78c47107f45e3047d3efbd47caa582 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -287,6 +287,8 @@ Extension Modules
 Library
 -------
 
+- Bug #1365984: urllib now opens "data:" URLs again.
+
 - Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
   is raised within the method itself on a previous call (e.g., passing in an
   illegal argument)