From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Newsgroups: gmane.emacs.bugs 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 Message-ID: <87sihmtfaq.fsf@gnu.org> References: <83oatvkemq.fsf@gnu.org> <87zjdeq8kj.fsf@gnu.org> <83bnpc48m4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1415949983 18808 80.91.229.3 (14 Nov 2014 07:26:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2014 07:26:23 +0000 (UTC) Cc: 18596@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 14 08:26:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XpBGr-0002SH-C1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Nov 2014 08:26:17 +0100 Original-Received: from localhost ([::1]:35172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpBGq-0003ia-Ts for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Nov 2014 02:26:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpBGi-0003al-BM for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:26:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpBGd-0002FU-3L for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:26:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpBGc-0002FQ-Vz for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:26:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XpBGc-0007af-8u for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Nov 2014 07:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18596 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141594992329120 (code B ref -1); Fri, 14 Nov 2014 07:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2014 07:25:23 +0000 Original-Received: from localhost ([127.0.0.1]:60075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpBFx-0007Zb-SN for submit@debbugs.gnu.org; Fri, 14 Nov 2014 02:25:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35413) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpBFv-0007ZS-9N for submit@debbugs.gnu.org; Fri, 14 Nov 2014 02:25:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpBFq-00024p-Rp for submit@debbugs.gnu.org; Fri, 14 Nov 2014 02:25:19 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpBFq-00024l-Ol for submit@debbugs.gnu.org; Fri, 14 Nov 2014 02:25:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpBFm-00035f-3V for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:25:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpBFh-0001z1-NB for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:25:10 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpBFh-0001yo-Km for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2014 02:25:05 -0500 Original-Received: from [190.246.172.180] (port=54828 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XpBFg-0007nW-Ry; Fri, 14 Nov 2014 02:25:05 -0500 In-Reply-To: <83bnpc48m4.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 16 Oct 2014 13:22:27 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95978 Eli Zaretskii 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") =20 -;; 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=3D17304'). 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=3D17304'). 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`. =20 ;; 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=3D1")))) (virtualenv (if python-shell-virtualenv-root (directory-file-name python-shell-virtualenv-root) nil))) Thanks, Fabi=C3=A1n