all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: fgallina@gnu.org (Fabián Ezequiel Gallina)
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18596@debbugs.gnu.org
Subject: bug#18596: 25.0.50; MS-Windows needs a different default for python-shell-interpreter-args
Date: Fri, 14 Nov 2014 04:25:01 -0300	[thread overview]
Message-ID: <87sihmtfaq.fsf@gnu.org> (raw)
In-Reply-To: <83bnpc48m4.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 16 Oct 2014 13:22:27 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> Ping!
>

Hi Eli,

Sorry for the delay but I wanted to have a Windows machine at hand to
test this.

FYI I tested this with Windows 7, Python 3.3, 3.4 and 2.7.8 and wasn't
able to replicate it.  The interpreter started without hanging.

It also worked on Windows XP With Python 2.7, so my best guess is that
this is a very especific problem that only happens with some particular
combination of Windows and Python version (I recall something similar in
an old bug).

Could you tell me those versions?

And if you are still being able to replicate this issue, does this patch
help?:

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 122f4ec..018ebd0 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -94,13 +94,16 @@
 ;;       python-shell-interpreter-args
 ;;       "-i C:\\Python27\\Scripts\\ipython-script.py")
 
-;; If you are experiencing missing or delayed output in your shells,
-;; that's likely caused by your Operating System's pipe buffering
-;; (e.g. this is known to happen running CPython 3.3.4 in Windows 7.
-;; See URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17304').  To
-;; fix this, using CPython's "-u" commandline argument or setting the
+;; Hangs, missing and/or delayed output in shells were known to happen
+;; on Windows, if you are experiencing a similar behavior, that's
+;; likely caused by your Operating System's pipe buffering (e.g. this
+;; used to happen running CPython 3.3.4 in Windows 7.  See URL
+;; `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17304').  To fix
+;; this, using CPython's "-u" commandline argument or setting the
 ;; "PYTHONUNBUFFERED" environment variable should help: See URL
-;; `https://docs.python.org/3/using/cmdline.html#cmdoption-u'.
+;; `https://docs.python.org/3/using/cmdline.html#cmdoption-u'.  For
+;; Windows "PYTHONUNBUFFERED" is set to "1" automatically by
+;; `python-shell-calculate-process-environment`.
 
 ;; The interaction relies upon having prompts for input (e.g. ">>> "
 ;; and "... " in standard Python shell) and output (e.g. "Out[1]: " in
@@ -2095,7 +2098,11 @@ uniqueness for different types of configurations."
   "Calculate process environment given `python-shell-virtualenv-root'."
   (let ((process-environment (append
                               python-shell-process-environment
-                              process-environment nil))
+                              process-environment
+                              ;; Avoid hangs on Windows out of the
+                              ;; box.  See Bug#18595 and Bug#18596.
+                              (when (eq system-type 'windows-nt)
+                                '("PYTHONUNBUFFERED=1"))))
         (virtualenv (if python-shell-virtualenv-root
                         (directory-file-name python-shell-virtualenv-root)
                       nil)))



Thanks,
Fabián






  reply	other threads:[~2014-11-14  7:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 15:12 bug#18596: 25.0.50; MS-Windows needs a different default for python-shell-interpreter-args Eli Zaretskii
2014-10-01 16:48 ` Glenn Morris
2014-10-01 16:50   ` Eli Zaretskii
2014-10-03  0:51 ` Fabián Ezequiel Gallina
2014-10-03  8:15   ` Eli Zaretskii
2014-10-16 10:22   ` Eli Zaretskii
2014-11-14  7:25     ` Fabián Ezequiel Gallina [this message]
2014-11-14 10:38       ` Eli Zaretskii
2014-11-14 13:05         ` Fabián Ezequiel Gallina
2014-11-14 14:29           ` Eli Zaretskii
2014-11-14 16:01             ` Fabián Ezequiel Gallina
2014-11-14 16:50               ` Eli Zaretskii
2014-11-14 20:55                 ` Fabián Ezequiel Gallina
2014-11-14 21:04                   ` Eli Zaretskii
2014-11-15  0:29                     ` Stefan Monnier
2014-11-15  7:37                       ` Eli Zaretskii
2014-11-16 14:21 ` Fabián Ezequiel Gallina
2014-11-16 15:45   ` Eli Zaretskii
2014-11-16 21:16     ` Fabián Ezequiel Gallina
2014-11-17  3:38       ` Eli Zaretskii

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=87sihmtfaq.fsf@gnu.org \
    --to=fgallina@gnu.org \
    --cc=18596@debbugs.gnu.org \
    --cc=eliz@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.