From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id 9BA6F727BE for ; Tue, 23 Dec 2014 12:32:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id sBNCWD6o015778 for ; Tue, 23 Dec 2014 12:32:13 GMT Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id usfaEC57g7Eg for ; Tue, 23 Dec 2014 12:32:13 +0000 (GMT) Received: from [192.168.3.10] ([192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id sBNCVx0n015765 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 23 Dec 2014 12:32:10 GMT Message-ID: <1419337956.6428.2.camel@linuxfoundation.org> From: Richard Purdie To: bitbake-devel Date: Tue, 23 Dec 2014 12:32:36 +0000 X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Subject: [PATCH] fetch2/wget: Fix horrible temp file handling X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2014 12:32:51 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Hardcoding a temp directory is bad practice and leads to races between the tests. There is no longer any good reason for doing this, drop it and ensure the files get cleaned up correctly. Signed-off-by: Richard Purdie diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 2e6da48..b081b76 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py @@ -174,7 +174,7 @@ class Wget(FetchMethod): """ Run fetch checkstatus to get directory information """ - f = tempfile.NamedTemporaryFile(dir="/tmp/s/", delete=False) + f = tempfile.NamedTemporaryFile() agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12" fetchcmd = self.basecmd @@ -186,7 +186,6 @@ class Wget(FetchMethod): fetchresult = "" f.close() - # os.unlink(f.name) return fetchresult def _check_latest_dir(self, url, versionstring, ud, d):