From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Will Wykeham Newsgroups: gmane.emacs.bugs Subject: bug#23095: 24.5; python-shell-unbuffered causes problems on Windows Date: Tue, 22 Mar 2016 15:01:27 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1458685100 11737 80.91.229.3 (22 Mar 2016 22:18:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2016 22:18:20 +0000 (UTC) To: 23095@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 22 23:18:11 2016 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 1aiUct-0000cV-8U for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 23:18:11 +0100 Original-Received: from localhost ([::1]:39904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiUcs-0003q7-Ku for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 18:18:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiUcm-0003nE-KJ for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 18:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiUck-0001dj-Md for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 18:18:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiUck-0001dT-Fg for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 18:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aiUck-0005kw-8D for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 18:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Will Wykeham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Mar 2016 22:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23095 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145868505822090 (code B ref -1); Tue, 22 Mar 2016 22:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 22:17:38 +0000 Original-Received: from localhost ([127.0.0.1]:60525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiUcL-0005kE-Ol for submit@debbugs.gnu.org; Tue, 22 Mar 2016 18:17:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiNod-00058f-6V for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:01:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiNoS-0003Dz-4p for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:01:46 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiNoS-0003Dr-23 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:01:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiNoL-0002Wk-JG for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 11:01:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiNoG-00034U-Si for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 11:01:33 -0400 Original-Received: from mail-vk0-x22a.google.com ([2607:f8b0:400c:c05::22a]:35663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiNoG-000344-J9 for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 11:01:28 -0400 Original-Received: by mail-vk0-x22a.google.com with SMTP id e6so257711314vkh.2 for ; Tue, 22 Mar 2016 08:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wykeham-net.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to; bh=bSm8CXTKIRGn6MBAGfmJn/lQaTY7HIbt/jvqbQhIeAQ=; b=FQQun5aazT0xvKrdOHJ9h28zLtAFIIho4wBk8GXcUv0sXkM5bDxCTv5l1/kGKnJkon A8Qr+djPx+HjsofmO3yKWGGLh6I/zKM+ZGk+UicHTAnRzxsvHFf2ZvYHlsmkYG9RTEr6 UCdUdNdv2pFg8ifHQgBdk5FQdrINUQAmahs5N17Cb7PInsaigtBdoSm7BbAjpJ536Opr CBJcSCzxouShAiVIrnweHujZ4nTOMl2EKNCy25meRAdKEGoTlHg517rlKn9m2B3ZlSRR hO43th7PRce++hSYm1ddvG7pnLPV1bGQmpMAFqhBNoQSHSpTEeDcJUlgkZWjIMsYYeIb A0xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=bSm8CXTKIRGn6MBAGfmJn/lQaTY7HIbt/jvqbQhIeAQ=; b=I2XZkvSVlZuTU76ihl0K4TBT352qnM6HnEOf9Um2S4XvAwq887PVyaPyhjPMhOCKLh n/xLaHqjRrNGfWezs6LFGsT7WJfeEHCVpXwFpzdpC3gscawe5AdIxv5plT4ivEcHOFl/ Bfrgz5nP/ThaxPIAHWm2xlfeD7qxVGscvAS0w0Id3MTeuSWN8kh9JPzGXuq2PyWenSLy GLrsztENOnixZJvi3FvYKM4vb+bB8N6UxpZj286xsiR9LxIm1EzGXR8auR2umcsqITDK eCFcKu4Ac9mmIo3QXuForjY3lO6SjFDRWNsvh9Q8Pk4rKTF0mcp18VgRdIiDoZIASk22 ZPbQ== X-Gm-Message-State: AD7BkJJMKT19K430F4KQqtpSdCja0l1oALaWaewCPKtp1QbmV0F+YtzaxDLcaGZOzqnDG5pPc17i9NpJ9czlng== X-Received: by 10.31.1.194 with SMTP id 185mr11106639vkb.114.1458658887591; Tue, 22 Mar 2016 08:01:27 -0700 (PDT) Original-Received: by 10.176.64.198 with HTTP; Tue, 22 Mar 2016 08:01:27 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Tue, 22 Mar 2016 18:17:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:115372 Archived-At: The relevant context is mostly below, but the important bits are: Emacs 24.5 Microsoft Windows 8 Python 2.7.11 >From a user facing point of view, the issue I'm having is that 'out of the box', the function python-shell-prompt-detect produces the warning "Warning (emacs): Python shell prompts cannot be detected". To reduce the test case down, this demonstrates the core problem: (let ((process-environment (python-shell-calculate-process-environment)) (code (concat "import sys\n" "print(sys.ps1)"))) (with-temp-buffer (let ((code-file (python-shell--save-temp-file code))) (call-process "python" code-file '(t nil) nil "-i") (delete-file code-file)) (buffer-string))) In an 'out of the box' emacs, with 'python-shell-unbuffered' set to t as default, this evaluates to an empty string. If python-shell-unbuffered is then set to nil, then the above evaluates to the expected ">>>\n". I haven't got to the bottom of why unbuffered is causing this problem. My suspicion is that it relates to the fact that PYTHONUNBUFFERED on Windows also causes python to process stdin/stdout as binary (which also affects line ending processing). Happy to provide any further information, testing etc. to help narrow down the issue. Regards, Will ******************************************** In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.3.9600 Configured using: `configure --prefix=/c/usr --host=i686-pc-mingw32' Important settings: value of $LANG: ENG locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: which-function-mode: t diff-auto-refine-mode: t global-highlight-parentheses-mode: t highlight-parentheses-mode: t show-paren-mode: t dtrt-indent-mode: t iswitchb-mode: t shell-dirtrack-mode: t winner-mode: t global-ede-mode: t global-semantic-mru-bookmark-mode: t global-semanticdb-minor-mode: t global-semantic-decoration-mode: t global-semantic-idle-completions-mode: t global-semantic-idle-scheduler-mode: t global-semantic-idle-summary-mode: t global-semantic-highlight-func-mode: t global-semantic-stickyfunc-mode: t semantic-mode: t delete-selection-mode: t cua-mode: t global-auto-revert-mode: t desktop-save-mode: t savehist-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-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 column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Type "q" in help window to restore its previous buffer. Quit [2 times] Mark set [2 times] "" Mark set Quit Mark saved where search started Type "q" in help window to restore its previous buffer. "" Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug conf-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct nxml-mode-expansions html-mode-expansions sgml-mode rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok browse-url url-util cua-rect rect expand-region text-mode-expansions cc-mode-expansions python-el-fgallina-expansions er-basic-expansions expand-region-core expand-region-custom semantic/tag-write semantic/edit debug misearch multi-isearch semantic/db-typecache semantic/imenu semantic/sb ede/dired vc-hg xhg-dvc xhg xhg-annotate xhg-mq xhg-log vc-svn eldoc which-func imenu semantic/tag-file semantic/db-file data-debug cedet-files tla hl-line smerge-mode dvc-state dvc-config dvc-diff dvc-fileinfo diff tla-gnus dvc-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader dvc-cmenu dvc-about dvc-version dvc-revlist semantic/wisent/python semantic/decorate/include warnings semantic/dep semantic/wisent/python-wy semantic/wisent semantic/wisent/wisent rx superword subword python json ede/cpp-root ede/emacs bzr-core tla-core pp tla-autoconf tla-defs dvc-log vc vc-dispatcher add-log diff-mode ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff xdarcs-core xgit-core xhg-core xmtn-minimal kalasm-mode qmake-mode bb-mode dts-mode php-mode etags cc-langs generic generic-x cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs dvc-autoloads dvc-unified dvc-tips dired-x dvc-core edebug dvc-lisp dvc-buffers derived dvc-ui dvc-register dvc-utils dvc-emacs ewoc dvc-defs dvc-site highlight-parentheses paren dtrt-indent iswitchb tramp tramp-compat tramp-loaddefs trampver shell pcomplete format-spec icomplete+ icomplete icicles icicles-mode easy-mmode dired icicles-cmd cus-edit cus-start cus-load icicles-mcmd icicles-mac icicles-fn icicles-face icicles-var icicles-opt ffap url-parse auth-source gnus-util password-cache url-vars color-theme sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils reporter thingatpt hexrgb two-column cl-macs cl winner windmove framemove findstr grep compile comint ansi-color ede/speedbar ede/files ede ede/base ede/auto ede/source eieio-speedbar eieio-custom wid-edit semantic/mru-bookmark semantic/db-mode semantic/decorate/mode semantic/complete semantic/idle eieio-opt help-mode speedbar sb-image dframe find-func semantic/ia semantic/analyze/refs semantic/db-find semantic/db-ref semantic/senator semantic/decorate ring pulse semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/db gv eieio-base semantic/ctxt semantic/format ezimage semantic/tag-ls semantic/find semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core mode-local cedet edmacro kmacro advice help-fns delsel cua-base saveplace autorevert filenotify desktop frameset cl-loaddefs cl-lib savehist server info easymenu package epg-config time-date tooltip electric uniquify 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 prog-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 nadvice 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 w32notify w32 multi-tty emacs) Memory information: ((conses 8 649133 135398) (symbols 32 52813 0) (miscs 32 11322 2303) (strings 16 127824 18777) (string-bytes 1 3792793) (vectors 8 54846) (vector-slots 4 1586068 18114) (floats 8 526 1355) (intervals 28 5955 102) (buffers 508 40))