From: Georg Brandl Date: Sat, 26 Nov 2005 16:51:02 +0000 (+0000) Subject: backport: bug #1365984, urllib and data: URLs^^ X-Git-Tag: v2.4.3c1~196 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fee85e6b3e43be00200a11c4d57f592500bade72;p=thirdparty%2FPython%2Fcpython.git backport: bug #1365984, urllib and data: URLs^^ --- diff --git a/Lib/urllib.py b/Lib/urllib.py index f00d02ff9eee..f700d718f4bc 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -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"): diff --git a/Misc/NEWS b/Misc/NEWS index 0c8b4e1847b2..a630755b731e 100644 --- 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).