mirror of https://github.com/python/cpython
Use fdopen() to create file from fd.
This commit is contained in:
parent
549ab8a98d
commit
3bd6fde4e3
|
@ -223,7 +223,7 @@ class URLopener:
|
|||
suffix = os.path.splitext(path)[1]
|
||||
(fd, filename) = tempfile.mkstemp(suffix)
|
||||
self.__tempfiles.append(filename)
|
||||
tfp = os.open(fd, 'wb')
|
||||
tfp = os.fdopen(fd, 'wb')
|
||||
result = filename, headers
|
||||
if self.tempcache is not None:
|
||||
self.tempcache[url] = result
|
||||
|
|
Loading…
Reference in New Issue