]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport: bug #1365984, urllib and data: URLs^^
authorGeorg Brandl <georg@python.org>
Sat, 26 Nov 2005 16:51:02 +0000 (16:51 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 26 Nov 2005 16:51:02 +0000 (16:51 +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 0c8b4e1847b277f1927b1b49389fc08932d68207..a630755b731e316b257b902e196bc5c577203f63 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -47,6 +47,8 @@ Extension Modules
 Library
 -------
 
+- Bug #1365984: urllib now opens "data:" URLs again.
+
 - Patch #1314396: Prevent threading.Thread.join() from blocking if a previous
   call caused an exception to be raised (e.g., calling join() with an illegal
   argument).