Use fdopen() to create file from fd.

This commit is contained in:
Jeremy Hylton 2002-10-11 14:36:24 +00:00
parent 549ab8a98d
commit 3bd6fde4e3
1 changed files with 1 additions and 1 deletions

View File

@ -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