all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15647: 24.3.50; python.el does not clean up temp file
@ 2013-10-18 18:51 Jorgen Schaefer
  2013-10-19 17:04 ` Andreas Röhler
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jorgen Schaefer @ 2013-10-18 18:51 UTC (permalink / raw)
  To: 15647

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)





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-11-23 19:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.