From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#15647: 24.3.50; python.el does not clean up temp file Date: Sun, 20 Oct 2013 18:33:53 +0300 Message-ID: <83li1oklcu.fsf@gnu.org> References: <87eh7ih0pz.fsf@orion.kollektiv-hamburg.de> <5262BB9D.4050802@easy-emacs.de> <52638B84.6070409@easy-emacs.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1382283256 20777 80.91.229.3 (20 Oct 2013 15:34:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2013 15:34:16 +0000 (UTC) Cc: 15647@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 20 17:34:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VXv1E-0001vH-KZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2013 17:34:16 +0200 Original-Received: from localhost ([::1]:36509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXv1E-0001tM-8t for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2013 11:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXv16-0001t6-CW for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2013 11:34:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXv10-0000s6-Or for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2013 11:34:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXv10-0000s2-LY for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2013 11:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VXv0z-0004hD-T5 for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2013 11:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2013 15:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15647 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 15647-submit@debbugs.gnu.org id=B15647.138228323718039 (code B ref 15647); Sun, 20 Oct 2013 15:34:01 +0000 Original-Received: (at 15647) by debbugs.gnu.org; 20 Oct 2013 15:33:57 +0000 Original-Received: from localhost ([127.0.0.1]:59260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXv0u-0004gs-Fp for submit@debbugs.gnu.org; Sun, 20 Oct 2013 11:33:56 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:41975) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXv0r-0004gc-FH for 15647@debbugs.gnu.org; Sun, 20 Oct 2013 11:33:55 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MUZ00C004EN6Y00@a-mtaout20.012.net.il> for 15647@debbugs.gnu.org; Sun, 20 Oct 2013 18:33:44 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MUZ00BFY4K7U4B0@a-mtaout20.012.net.il>; Sun, 20 Oct 2013 18:33:44 +0300 (IDT) In-reply-to: <52638B84.6070409@easy-emacs.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79422 Archived-At: > Date: Sun, 20 Oct 2013 09:51:32 +0200 > From: Andreas Röhler > Cc: 15647@debbugs.gnu.org > > > IIUC the purpose is to make sure it's erased and to make sure it's > > erased *after* the use. Whether it does that, I don't know. > > But doing it in Elisp would otherwise require detecting the next prompt > > Don't think so. Once the file is sent to process, it's sent. That's Unix-speak: deleting a file that is potentially in use. Outside of Posix, deleting a file immediately after submitting it to a process will at best fail (because the process is still using it), and at worst cause trouble (because the process didn't yet have enough time to even open the file). In fact, in this case, even on Unix this proposal will cause trouble, because the command sent to Python might take time to execute on the Python side, and we might already have deleted the file when Python tries to open it. I think in this case the better place to delete the file is in python-shell-send-file, as part of the command sent to Python, because that's where we know that the file was used up and closed by the Python interpreter. > A remaining question: what to do if the command fails? Maybe the temp file is of interest than? > Which might be an argument to do it from Python, as the error might prevent further action, i.e. deleting. No, it's an argument to add independent logging facilities to python.el, IMO. IOW, if python.el wants to have debugging features, it should have them without relying on the Python interpreter and without interfering with the "normal" workflow (whereby the file is deleted after being used). Relying on a temporary file to remain in the filesystem for prolonged periods of time is not a good idea anyway.