all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Einstein <Deinst@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: Python mode hang.
Date: Thu, 13 Dec 2007 08:39:26 -0800 (PST)	[thread overview]
Message-ID: <3dd19e5c-4293-4b75-b02d-dbfc431544b5@s8g2000prg.googlegroups.com> (raw)

My emacs 22 froze completely on windows XP when attempting to start
and inferior python process.  This there are a few fixes for this
symptom posted here on gnu.bug.emacs, and it apears that the symptom
is also fixed in the latest version in subversion.  However, I
believe, that the underlying problem still exists, and that emacs is
relying on the python sub process being very well behaved.  My
knowledge of both emacs lisp and python are not great, but I suspect
that the function python-send-receive in python.el is suspect.

(defun python-send-receive (string)
  "Send STRING to inferior Python (if any) and return result.
The result is what follows `_emacs_out' in the output."
  (python-send-string string)
  (let ((proc (python-proc)))
    (with-current-buffer (process-buffer proc)
      (set (make-local-variable 'python-preoutput-result) nil)
      (while (progn
               (accept-process-output proc 5)
               (null python-preoutput-result)))
      (prog1 python-preoutput-result
        (kill-local-variable 'python-preoutput-result)))))

The problem here is that if the python subprocess never returns, or
never outputs text containing '_emacs_out', emacs will be stuck in the
loop

(while (progn
               (accept-process-output proc 5)
               (null python-preoutput-result)))

Here python-preoutput-result is updated by python-preoutput-filter to
contain the text after '_emacs_out' and before the next prompt.

My understanding of emacs lisp says that this loop should hang emacs
if the python process never sets python-preoutput-result.  I doubt
that this is the intended behavior.  None of the other inferior modes
seem to be designed this way, but I have not done an exhaustive
search.

Unfortunately, I have no idea of the correct way of approaching this
problem.

              Thank You,
                      Deinst


                 reply	other threads:[~2007-12-13 16:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3dd19e5c-4293-4b75-b02d-dbfc431544b5@s8g2000prg.googlegroups.com \
    --to=deinst@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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.