Commit 1f663574 authored by Georg Brandl's avatar Georg Brandl

bug #1365984: urllib and data: URLs. Problem was that cStringIO objects cannot...

bug #1365984: urllib and data: URLs. Problem was that cStringIO objects cannot be assigned attributes on the fly.
parent 7dece669
...@@ -556,7 +556,7 @@ class URLopener: ...@@ -556,7 +556,7 @@ class URLopener:
msg = '\n'.join(msg) msg = '\n'.join(msg)
f = StringIO(msg) f = StringIO(msg)
headers = mimetools.Message(f, 0) headers = mimetools.Message(f, 0)
f.fileno = None # needed for addinfourl #f.fileno = None # needed for addinfourl
return addinfourl(f, headers, url) return addinfourl(f, headers, url)
...@@ -813,7 +813,10 @@ class addbase: ...@@ -813,7 +813,10 @@ class addbase:
self.read = self.fp.read self.read = self.fp.read
self.readline = self.fp.readline self.readline = self.fp.readline
if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines 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__"): if hasattr(self.fp, "__iter__"):
self.__iter__ = self.fp.__iter__ self.__iter__ = self.fp.__iter__
if hasattr(self.fp, "next"): if hasattr(self.fp, "next"):
......
...@@ -287,6 +287,8 @@ Extension Modules ...@@ -287,6 +287,8 @@ Extension Modules
Library Library
------- -------
- Bug #1365984: urllib now opens "data:" URLs again.
- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception - 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 is raised within the method itself on a previous call (e.g., passing in an
illegal argument) illegal argument)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment