Mercurial > emacs
comparison lisp/progmodes/python.el @ 111580:bd93bfc2fc83
* lisp/progmodes/python.el (run-python): Explain why we remove the current
directory from sys.path. Suggested by Eric Hanchrow <erich@cozi.com>.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Wed, 17 Nov 2010 10:00:16 -0500 |
| parents | 132f2dfd549f |
| children | 3655cc4062e4 |
comparison
equal
deleted
inserted
replaced
| 111579:4433803ef920 | 111580:bd93bfc2fc83 |
|---|---|
| 1584 ;; invoked. Would support multiple processes better. | 1584 ;; invoked. Would support multiple processes better. |
| 1585 (when (or new (not (comint-check-proc python-buffer))) | 1585 (when (or new (not (comint-check-proc python-buffer))) |
| 1586 (with-current-buffer | 1586 (with-current-buffer |
| 1587 (let* ((cmdlist | 1587 (let* ((cmdlist |
| 1588 (append (python-args-to-list cmd) | 1588 (append (python-args-to-list cmd) |
| 1589 ;; It's easy for the user to cause the process to be | |
| 1590 ;; started without realizing it (e.g. to perform | |
| 1591 ;; completion); for this reason loading files from the | |
| 1592 ;; current directory is a security risk. See | |
| 1593 ;; http://article.gmane.org/gmane.emacs.devel/103569 | |
| 1589 '("-i" "-c" "import sys; sys.path.remove('')"))) | 1594 '("-i" "-c" "import sys; sys.path.remove('')"))) |
| 1590 (path (getenv "PYTHONPATH")) | 1595 (path (getenv "PYTHONPATH")) |
| 1591 (process-environment ; to import emacs.py | 1596 (process-environment ; to import emacs.py |
| 1592 (cons (concat "PYTHONPATH=" | 1597 (cons (concat "PYTHONPATH=" |
| 1593 (if path (concat path path-separator)) | 1598 (if path (concat path path-separator)) |
