all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: 15647@debbugs.gnu.org
Subject: bug#15647: 24.3.50; python.el does not clean up temp file
Date: Sun, 20 Oct 2013 18:33:53 +0300	[thread overview]
Message-ID: <83li1oklcu.fsf@gnu.org> (raw)
In-Reply-To: <52638B84.6070409@easy-emacs.de>

> Date: Sun, 20 Oct 2013 09:51:32 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 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.





  reply	other threads:[~2013-10-20 15:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 18:51 bug#15647: 24.3.50; python.el does not clean up temp file Jorgen Schaefer
2013-10-19 17:04 ` Andreas Röhler
2013-10-19 21:51   ` Stefan Monnier
2013-10-20  7:51     ` Andreas Röhler
2013-10-20 15:33       ` Eli Zaretskii [this message]
2013-10-20 16:25         ` Andreas Röhler
2013-10-20 18:27         ` Glenn Morris
2013-10-20 18:31           ` Glenn Morris
2013-10-20 19:12           ` Eli Zaretskii
2013-10-21  0:53             ` Glenn Morris
2013-11-23 19:39         ` Glenn Morris
2013-10-20  2:01 ` Glenn Morris
2013-11-23  3:13 ` Glenn Morris
2013-11-23  4:21   ` Glenn Morris
2013-11-23 13:34     ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83li1oklcu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=15647@debbugs.gnu.org \
    --cc=andreas.roehler@easy-emacs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.