From 3bd6fde4e36bac98d9dab6060bf8791ca99929b5 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Fri, 11 Oct 2002 14:36:24 +0000 Subject: [PATCH] Use fdopen() to create file from fd. --- Lib/urllib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/urllib.py b/Lib/urllib.py index f098b5d0faa..4dd76dffa97 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -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