From: Jeremy Hylton Date: Fri, 11 Oct 2002 14:36:24 +0000 (+0000) Subject: Use fdopen() to create file from fd. X-Git-Tag: v2.3c1~3816 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bd6fde4e36bac98d9dab6060bf8791ca99929b5;p=thirdparty%2FPython%2Fcpython.git Use fdopen() to create file from fd. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index f098b5d0faae..4dd76dffa97b 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