mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
Use fdopen() to create file from fd.
This commit is contained in:
parent
549ab8a98d
commit
3bd6fde4e3
1 changed files with 1 additions and 1 deletions
|
|
@ -223,7 +223,7 @@ def retrieve(self, url, filename=None, reporthook=None, data=None):
|
|||
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…
Add table
Add a link
Reference in a new issue