emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#15647: closed (24.3.50; python.el does not clean u


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#15647: closed (24.3.50; python.el does not clean up temp file)
Date: Sat, 23 Nov 2013 19:40:04 +0000

Your message dated Sat, 23 Nov 2013 14:39:52 -0500
with message-id <address@hidden>
and subject line Re: bug#15647: 24.3.50; python.el does not clean up temp file
has caused the debbugs.gnu.org bug report #15647,
regarding 24.3.50; python.el does not clean up temp file
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
15647: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15647
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; python.el does not clean up temp file Date: Fri, 18 Oct 2013 20:51:04 +0200
python.el will use temporary files to communicate with the inferior
python process. These temporary files are never cleaned up.

To reproduce, simply run M-x run-python and check the temp dir. It has a
"py?????" file in it. Kill the buffer and repeat, such files will
accumulate.

The following simple patch will delete the file after loading it.


--- lisp/progmodes/python.el    2013-10-07 18:51:26 +0000
+++ lisp/progmodes/python.el    2013-10-18 18:47:02 +0000
@@ -2048,6 +2048,8 @@
                (file-name (or (buffer-file-name) temp-file-name)))
           (with-temp-file temp-file-name
             (insert string)
+            (insert (format "\n\nimport os ; os.remove('''%s''')\n"
+                            temp-file-name))
             (delete-trailing-whitespace))
           (python-shell-send-file file-name process temp-file-name))
       (comint-send-string process string)



--- End Message ---
--- Begin Message --- Subject: Re: bug#15647: 24.3.50; python.el does not clean up temp file Date: Sat, 23 Nov 2013 14:39:52 -0500 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.4

Eli Zaretskii wrote:

> 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.

Agreed; done.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]