emacs-devel
[Top][All Lists]
Advanced

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

23.0.50; pychecker (via python-check) hangs when python script reads inp


From: Paul Molodowitch
Subject: 23.0.50; pychecker (via python-check) hangs when python script reads input on windows
Date: Thu, 8 Nov 2007 02:30:31 -0800


--text follows this line--

In windows, when I invoke python-check on a script such as the following:

---Python Script START---

# This is just here to check that clicking on a warning
# in the compilation window still takes us to the correct
# line number
if False:
    nonExistant("I should raise a warning")

raw_input("\n" \
              "This will hang pychecker in emacs...\n" \
              "Press enter to exit...")

---Python Script END---

then the emacs compilation buffer seems to hang forever - it is waiting for user input, but since the buffer is read only, there is no way to give it any.  I tried changing python-check to:

(defun python-check (command)
  "Check a Python file (default current buffer's file).
Runs COMMAND, a shell command, as if by `compile'.
See `python-check-command' for the default."
  (interactive
   (list (read-string "Checker command: "
              (or python-saved-check-command
              (concat python-check-command " "
                  (let ((name (buffer-file-name)))
                    (if name
                    (file-name-nondirectory name))))))))
  (setq python-saved-check-command command)
  (require 'compile)                    ;To define compilation-* variables.
  (save-some-buffers (not compilation-ask-about-save) nil)
  (let ((compilation-error-regexp-alist
     (cons '("(\\([^,]+\\), line \\([0-9]+\\))" 1 2)
           compilation-error-regexp-alist)))
    (compilation-start command t)))

 - the only difference being the final line, line 1142, is changed from:

    (compilation-start command)))

to:

    (compilation-start command t)))

By putting the output buffer in comint-mode, the buffer at least now accepts input, so we can press enter, unfreeze it, and we can see our results (and even still click on the line numbers, etc).  However, this is a sort of crappy solution, as it hasn't updated the buffer to display the prompt at the point when it is actually waiting for input - ie, I see:

---Buffer display START---

-*- mode: compilation; default-directory: "c:/Documents and Settings/Elrond/Desktop/" -*-
Comint started at Thu Nov 08 01:28:37

C:\Dev\Python25\pychecker-0.8.17\build\scripts-2.5\pychecker.bat --stdlib emacs_pychecker_bug.py

c:\Documents and Settings\Elrond\Desktop>C:\Dev\Python25\python.exe C:\Dev\Python25\Lib\site-packages\pychecker\checker.py --stdlib emacs_pychecker_bug.py

---Buffer display END---

...when it is supposed to be prompting me to press enter. (Incidentally, this is also the output I see without the change to python-check).

It appears that the real culprit in this case is not in python.el, but somewhere in the implementation of process input/output piping on windows - if I simply start up a shell, and invoke pychecker on our script from there, we get the same behavior.

I've only tried this on a windows XP system...

Now, for some fun information about my environment:

OS: Microsoft Windows XP
    Professional x64 Edition
    Version 2003
    Service Pack 2

Python version:
Python 2.5.1 (r251:54863, Apr 18 2007, 09:02:36) [MSC v.1400 64 bit (AMD64)] on win32

Pychecker version: 0.8.17

configure command:
configure --with-gcc --cflags -I%imglib-dir% --no-cygwin --cflags -mno-cygwin

And here's the stuff that report-emacs-bug gave:

In GNU Emacs 23.0.50.1 (i386-mingw-nt5.2.3790)
 of 2007-11-07 on DEINONYCHUS
Windowing system distributor `Microsoft Corp.', version 5.2.3790
configured using `configure --with-gcc (3.4) --cflags -IC:DevProjectsmacs
timageLibs -mno-cygwin'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Python

Minor modes in effect:
  eldoc-mode: t
  show-paren-mode: t
  cua-mode: t
  recentf-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <down-mouse-1> <mouse-1> <home>
<delete> C-s C-x C-k <help-echo> C-x C-k <help-echo>
<help-echo> <drag-n-drop> <help-echo> <down-mouse-1>
<mouse-1> <escape> x r e p o r t <tab> <return> p y
c h e c k e r SPC h a n g s SPC <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <down-mouse-1>
<mouse-1> <help-echo> <down-mouse-1> <mouse-1> C-h
k <help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <menu-bar> <Python> <Check file> <help-echo>
<help-echo> <down-mouse-1> <mouse-1> <help-echo> p
y c h e c k e r SPC ( p y t h o n - c h e c k - c o
m m a n d ) SPC h a n d <backspace> g s SPC w h e n
SPC p y t h o n SPC s c r i p t SPC n e e d s SPC i
n p <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
r e a d s SPC i n <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
c a l l s SPC <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> SPC r e a d s SPC
i n p u t <return> <help-echo> <down-mouse-1> <mouse-movement>
<mouse-movement> <drag-mouse-1> <down-mouse-1> <mouse-1>
<down-mouse-1> <mouse-1> <return> <return> <up> <wheel-down>
<wheel-down> <wheel-down> <wheel-down> <wheel-down>
<wheel-up> <double-wheel-up> <wheel-up> <wheel-down>
<double-wheel-down> <wheel-down> <wheel-down> <wheel-down>
<wheel-down> <wheel-down> <double-wheel-down> <wheel-down>
<wheel-down> <wheel-up> <double-wheel-up> <wheel-down>
<wheel-up> <double-wheel-up> <wheel-up> <double-wheel-up>
<wheel-up> <double-wheel-up> <wheel-up> <wheel-up>
<double-wheel-up> <triple-wheel-up> <down-mouse-1>
<mouse-1> C-x C-k C-h C-v C-c C-v <return> <escape>
x e <up> <return>

Recent messages:
Loading c:/Documents and Settings/Elrond/UnixHome/.recentf...done
Cleaning up the recentf list...done (0 removed)
For information about GNU Emacs and the GNU system, type C-h C-a.
Fontifying *Python*... (regexps...........)
For information about GNU Emacs and the GNU system, type C-h C-a.
Wrote c:/Documents and Settings/Elrond/Desktop/test.py
Type C-x 1 to remove help window. 
byte-code: Beginning of buffer [2 times]
(No files need saving)
goto-history-element: Beginning of history; no preceding item

Attachment: emacs_pychecker_bug.py
Description: Text document


reply via email to

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