Commit 3bd6fde4 authored by Jeremy Hylton's avatar Jeremy Hylton

Use fdopen() to create file from fd.

parent 549ab8a9
...@@ -223,7 +223,7 @@ class URLopener: ...@@ -223,7 +223,7 @@ class URLopener:
suffix = os.path.splitext(path)[1] suffix = os.path.splitext(path)[1]
(fd, filename) = tempfile.mkstemp(suffix) (fd, filename) = tempfile.mkstemp(suffix)
self.__tempfiles.append(filename) self.__tempfiles.append(filename)
tfp = os.open(fd, 'wb') tfp = os.fdopen(fd, 'wb')
result = filename, headers result = filename, headers
if self.tempcache is not None: if self.tempcache is not None:
self.tempcache[url] = result self.tempcache[url] = result
......
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