Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 421265 - app-emacs/cedet-1.1 and app-editors/emacs-24.1: stale python process
Summary: app-emacs/cedet-1.1 and app-editors/emacs-24.1: stale python process
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Emacs project
URL: https://answers.launchpad.net/python-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-15 19:19 UTC by Martin von Gagern
Modified: 2012-06-24 21:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2012-06-15 19:19:27 UTC
When I open a *.py file in emacs, and then exit emacs, I get a message about there being at least one python process still running, and whether or not I'd want to kill that. This is somewhat annoying, so I consider it a bug.

At first there were two processes running, and I considered this a bug in app-emacs/python-mode. Downgrading that package reduced the number of processes to one. I then realized that emacs 24 ships its own python mode, and removed the python-mode package altogether. Still one process at termination.

Now I read about edebug and elisp function instrumentation, and finally managed to obtain a backtrace for the location where that process was started.

  run-python(nil t)
  python-proc()
  semantic-python-get-system-include-path()
  (progn (semantic-python-get-system-include-path))
  (if (featurep (quote python))
      (progn (semantic-python-get-system-include-path)))
  (when (featurep (quote python)) (semantic-python-get-system-include-path))
  eval((when (featurep (quote python))
      (semantic-python-get-system-include-path)))
  custom-initialize-reset(semantic-python-dependency-system-include-path 
      (when (featurep (quote python))
      (semantic-python-get-system-include-path)))
  custom-declare-variable(semantic-python-dependency-system-include-path
      (when (featurep (quote python))
      (semantic-python-get-system-include-path))
      ("/usr/share/emacs/site-lisp/cedet/semantic/wisent/wisent-python.elc"
      . 1411) :group python :group semantic
      :type (repeat (directory :tag "Directory"))
      :set #[…])
  wisent-python-default-setup()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook python-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook
      prog-mode-hook python-mode-hook))
  run-mode-hooks(python-mode-hook)
  python-mode()
  set-auto-mode-0(python-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)
  find-file-noselect-1(#<buffer x.py> "~/tmp/x.py" nil nil "~/tmp/x.py" nil)
  find-file-noselect("~/tmp/x.py" nil nil t)
  find-file("~/tmp/x.py" t)
  call-interactively(find-file nil nil)

So the code which triggers this appears to be /usr/share/emacs/site-lisp/cedet/semantic/wisent/wisent-python.el lines 79 through 83:

(defcustom-mode-local-semantic-dependency-system-include-path
  python-mode semantic-python-dependency-system-include-path
  (when (featurep 'python)
    (semantic-python-get-system-include-path))
  "The system include path used by Python language.")

It would be nice if
a) the call to (semantic-python-get-system-include-path) could be avoided or
   postponed till that value was actually needed,
b) the started process were automatically terminated as well or
c) the process could be killed without a question when closing emacs
Comment 1 Ulrich Müller gentoo-dev 2012-06-16 17:38:47 UTC
Can you report this upstream please?
Comment 2 Martin von Gagern 2012-06-16 18:21:28 UTC
(In reply to comment #1)
> Can you report this upstream please?

Which upstream? The URL you pasted is for "python-mode.el", which as far as I understand things is using a different code base from the "python.el" shipped with emacs, which is what I'm using now. And both of these are distinct from cedet, aren't they? So which of these should I report this against?

1. Emacs as a whole, using bug-gnu-emacs@gnu.org
2. Dave Love, the original author of python.el, via e-mail
3. The cedet project, via its sourceforge bug tracker
4. Richard Kim, the current maintainer of wisent-python.el, via e-mail
5. Jan Moringen, the most recent copyright-holder of wisent-python.el
6. The python-mode launchpad project, as your URL indicates
Comment 3 Ulrich Müller gentoo-dev 2012-06-16 18:53:49 UTC
As far as I can see, one of your two python processes is started by python-mode (from app-emacs/python-mode) when py-start-run-py-shell it non-nil. This should be the same issue as linked in the URL and should be reported to Andreas Roehler.

The code that starts the second python process:

(In reply to comment #0)
> (defcustom-mode-local-semantic-dependency-system-include-path
>   python-mode semantic-python-dependency-system-include-path
>   (when (featurep 'python)
>     (semantic-python-get-system-include-path))
>   "The system include path used by Python language.")

seems only to be present in stand-alone app-emacs/cedet-1.1. In the CEDET included with Emacs 24.1 this is simply (in cedet/semantic/wisent/python.el):

(defcustom-mode-local-semantic-dependency-system-include-path
  python-mode semantic-python-dependency-system-include-path
  nil
  "The system include path used by Python language.")

So with the CEDET and progmodes/python.el that are included with Emacs 24.1, the issue shouldn't exist. Could you verify this?
Comment 4 Martin von Gagern 2012-06-24 21:13:54 UTC
(In reply to comment #3)
> So with the CEDET and progmodes/python.el that are included with Emacs 24.1,
> the issue shouldn't exist. Could you verify this?

Sorry it took me so long. Yes, removing the stand-alone cedet package does make the python process go away. I hadn't realized that cedet was included in emacs. Thanks a lot for pointing this out.