unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17304: Python mode delays evaluation
@ 2014-04-19 12:04 Márton Marczell
  2014-05-03  1:16 ` Glenn Morris
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Márton Marczell @ 2014-04-19 12:04 UTC (permalink / raw)
  To: 17304

[-- Attachment #1: Type: text/plain, Size: 4931 bytes --]

From: dalokmarcinak@gmail.com
To: bug-gnu-emacs@gnu.org
Subject: 24.3; Python mode delays evaluation
--text follows this line--
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':


---
When I run a Python 3.3.4 prompt inside Emacs 24.3 on Windows 7, correct
commands are evaluated immediately, but incorrect ones are delayed (I have
to press Enter one more time), as seen below:

    >>> 1
    1
    >>> nonsense
    >>>
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    NameError: name 'nonsense' is not defined
---

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
c:/Program Files/lispbox-0.7/emacs/etc/DEBUG.


In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.7) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'

Important settings:
  value of $LANG: HUN
  locale-coding-system: cp1250
  default enable-multibyte-characters: t

Major mode: Inferior Python

Minor modes in effect:
  compilation-shell-minor-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o C-g M-x r u n . - <backspace> <backspace>
- p y <return> M-x r e p o <tab> r t <tab> <return>
P y t h o n SPC m o d e SPC d e l a y s SPC e v a l
u t a i o n <backspace> <backspace> <backspace> <backspace>
<backspace> a t i o n <return> C-y <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <down> <return>
<up> - - - <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> - - - C-c C-c y
e s <return> <help-echo> <down-mouse-1> <mouse-1> M-x
r e p o <tab> r t <tab> <return>

Recent messages:
Checking 87 files in c:/Program Files/lispbox-0.7/emacs/lisp/calc...
Checking 77 files in c:/Program Files/lispbox-0.7/emacs/lisp/obsolete...
Checking 2 files in c:/Program Files/lispbox-0.7/emacs/leim...
Checking for load-path shadows...done
Mark set [2 times]
Sending...
Mark set [2 times]
Sending via mail...
Sending...done
Making completion list...

Load-path shadows:
None found.

Features:
(mailalias mailclient browse-url shadow sort mail-extr emacsbug message
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mail-utils help-mode compile python rx edmacro kmacro
2048-game-autoloads auctex-autoloads tex-site info gnuplot-autoloads
gnuplot-mode-autoloads js2-mode-autoloads finder-inf
latex-preview-pane-autoloads lua-mode-autoloads markdown-mode+-autoloads
markdown-mode-autoloads php-mode-autoloads package warnings sql easymenu
thingatpt tramp tramp-compat auth-source eieio byte-opt bytecomp
byte-compile cconv gnus-util mm-util mail-prsvr password-cache
tramp-loaddefs shell pcomplete comint ansi-color ring format-spec advice
help-fns cl-lib advice-preload time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win
w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
w32 multi-tty emacs)

[-- Attachment #2: Type: text/html, Size: 5919 bytes --]

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

* bug#17304: Python mode delays evaluation
  2014-04-19 12:04 bug#17304: Python mode delays evaluation Márton Marczell
@ 2014-05-03  1:16 ` Glenn Morris
  2014-05-03  6:20   ` Eli Zaretskii
  2014-07-19 13:36 ` Fabián Ezequiel Gallina
  2014-07-20 20:28 ` Fabián Ezequiel Gallina
  2 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2014-05-03  1:16 UTC (permalink / raw)
  To: Márton Marczell; +Cc: 17304

Márton Marczell wrote:

> When I run a Python 3.3.4 prompt inside Emacs 24.3 on Windows 7, correct
> commands are evaluated immediately, but incorrect ones are delayed (I have
> to press Enter one more time), as seen below:
>
>     >>> 1
>     1
>     >>> nonsense
>     >>>
>     Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>     NameError: name 'nonsense' is not defined
[...]
> In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)

FWIW, I cannot reproduce this with Emacs 24.3 and Python 3.4.0 on GNU/Linux.





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

* bug#17304: Python mode delays evaluation
  2014-05-03  1:16 ` Glenn Morris
@ 2014-05-03  6:20   ` Eli Zaretskii
  2014-05-03 17:11     ` Márton Marczell
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2014-05-03  6:20 UTC (permalink / raw)
  To: Glenn Morris; +Cc: dalokmarcinak, 17304

> From: Glenn Morris <rgm@gnu.org>
> Date: Fri, 02 May 2014 21:16:35 -0400
> Cc: 17304@debbugs.gnu.org
> 
> Márton Marczell wrote:
> 
> > When I run a Python 3.3.4 prompt inside Emacs 24.3 on Windows 7, correct
> > commands are evaluated immediately, but incorrect ones are delayed (I have
> > to press Enter one more time), as seen below:
> >
> >     >>> 1
> >     1
> >     >>> nonsense
> >     >>>
> >     Traceback (most recent call last):
> >     File "<stdin>", line 1, in <module>
> >     NameError: name 'nonsense' is not defined
> [...]
> > In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
> 
> FWIW, I cannot reproduce this with Emacs 24.3 and Python 3.4.0 on GNU/Linux.

Probably because of buffering differences: pipes are fully buffered on
Windows, even those used for stderr.  If that is indeed the case, I
don't think this problem can be fixed in Emacs.

To the OP: do you have the same problem if you redirect Python's
output streams in the shell, using "2>&1 |" ?  The other side of the
pipe could be cat.exe, for example.





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

* bug#17304: Python mode delays evaluation
  2014-05-03  6:20   ` Eli Zaretskii
@ 2014-05-03 17:11     ` Márton Marczell
  2014-05-03 17:21       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Márton Marczell @ 2014-05-03 17:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17304

[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]

Yes, if I run "python 2>&1 | cat.exe" in the cmd.exe prompt, I get the
exact same behaviour. But I don't have the same problem with Python 2.


On Sat, May 3, 2014 at 8:20 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Glenn Morris <rgm@gnu.org>
> > Date: Fri, 02 May 2014 21:16:35 -0400
> > Cc: 17304@debbugs.gnu.org
> >
> > Márton Marczell wrote:
> >
> > > When I run a Python 3.3.4 prompt inside Emacs 24.3 on Windows 7,
> correct
> > > commands are evaluated immediately, but incorrect ones are delayed (I
> have
> > > to press Enter one more time), as seen below:
> > >
> > >     >>> 1
> > >     1
> > >     >>> nonsense
> > >     >>>
> > >     Traceback (most recent call last):
> > >     File "<stdin>", line 1, in <module>
> > >     NameError: name 'nonsense' is not defined
> > [...]
> > > In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
> >
> > FWIW, I cannot reproduce this with Emacs 24.3 and Python 3.4.0 on
> GNU/Linux.
>
> Probably because of buffering differences: pipes are fully buffered on
> Windows, even those used for stderr.  If that is indeed the case, I
> don't think this problem can be fixed in Emacs.
>
> To the OP: do you have the same problem if you redirect Python's
> output streams in the shell, using "2>&1 |" ?  The other side of the
> pipe could be cat.exe, for example.
>

[-- Attachment #2: Type: text/html, Size: 2022 bytes --]

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

* bug#17304: Python mode delays evaluation
  2014-05-03 17:11     ` Márton Marczell
@ 2014-05-03 17:21       ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2014-05-03 17:21 UTC (permalink / raw)
  To: Márton Marczell; +Cc: 17304

> Date: Sat, 3 May 2014 19:11:27 +0200
> From: Márton Marczell <dalokmarcinak@gmail.com>
> Cc: Glenn Morris <rgm@gnu.org>, 17304@debbugs.gnu.org
> 
> Yes, if I run "python 2>&1 | cat.exe" in the cmd.exe prompt, I get the
> exact same behaviour. But I don't have the same problem with Python 2.

Then I guess you should ask about this on the Python mailing list.





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

* bug#17304: Python mode delays evaluation
  2014-04-19 12:04 bug#17304: Python mode delays evaluation Márton Marczell
  2014-05-03  1:16 ` Glenn Morris
@ 2014-07-19 13:36 ` Fabián Ezequiel Gallina
  2014-07-20 20:28 ` Fabián Ezequiel Gallina
  2 siblings, 0 replies; 7+ messages in thread
From: Fabián Ezequiel Gallina @ 2014-07-19 13:36 UTC (permalink / raw)
  To: 17304


Does running python with the -u switch help?

(setq python-shell-interpreter-args "-u -i")



Regards,
Fabián





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

* bug#17304: Python mode delays evaluation
  2014-04-19 12:04 bug#17304: Python mode delays evaluation Márton Marczell
  2014-05-03  1:16 ` Glenn Morris
  2014-07-19 13:36 ` Fabián Ezequiel Gallina
@ 2014-07-20 20:28 ` Fabián Ezequiel Gallina
  2 siblings, 0 replies; 7+ messages in thread
From: Fabián Ezequiel Gallina @ 2014-07-20 20:28 UTC (permalink / raw)
  To: 17304-done


I was able to replicate this on a Windows 7 machine running Python
3.3.4.  Adding the "-u" switch to `python-shell-interpreter-args' seems
to help as no occurrences of the issue happened ever since.

Added a commentary about this at revno 117392 in the emacs-24 branch
just in case this issue gets to mess with more people.


Cheers,
Fabián





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

end of thread, other threads:[~2014-07-20 20:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-19 12:04 bug#17304: Python mode delays evaluation Márton Marczell
2014-05-03  1:16 ` Glenn Morris
2014-05-03  6:20   ` Eli Zaretskii
2014-05-03 17:11     ` Márton Marczell
2014-05-03 17:21       ` Eli Zaretskii
2014-07-19 13:36 ` Fabián Ezequiel Gallina
2014-07-20 20:28 ` Fabián Ezequiel Gallina

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).