From: Georg Brandl Date: Sat, 26 Nov 2005 16:50:44 +0000 (+0000) Subject: bug #1365984: urllib and data: URLs. Problem was that cStringIO objects cannot be... X-Git-Tag: v2.5a0~1098 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f663574ee154dfc95b883747137040f51ea7ef6;p=python bug #1365984: urllib and data: URLs. Problem was that cStringIO objects cannot be assigned attributes on the fly. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index f00d02ff9e..f700d718f4 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 de637e1f9f..c087a11e0e 100644 --- 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)