From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Federico Beffa Newsgroups: gmane.emacs.bugs Subject: bug#18052: 24.3; python.el and ipython shell Date: Fri, 18 Jul 2014 15:51:47 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1405691598 26258 80.91.229.3 (18 Jul 2014 13:53:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jul 2014 13:53:18 +0000 (UTC) To: 18052@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 18 15:53:13 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 1X88az-0008Vz-C0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Jul 2014 15:53:09 +0200 Original-Received: from localhost ([::1]:49959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88ay-00048G-Rf for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Jul 2014 09:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88au-00048B-N8 for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:53:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X88at-0002KW-9B for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:53:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88at-0002KG-58 for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X88as-0005qq-ID for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Federico Beffa Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Jul 2014 13:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18052 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.140569153122414 (code B ref -1); Fri, 18 Jul 2014 13:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Jul 2014 13:52:11 +0000 Original-Received: from localhost ([127.0.0.1]:58019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X88Zz-0005pO-PM for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:52:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60008) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X88Zt-0005oq-7H for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:52:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X88Zm-0001Tt-4c for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:51:55 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88Zm-0001To-1v for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:51:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88Zk-00045F-Ib for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:51:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X88Zi-0001Rr-OM for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:51:52 -0400 Original-Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:56546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X88Zi-0001Ql-Bg for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 09:51:50 -0400 Original-Received: by mail-la0-f53.google.com with SMTP id gl10so2921283lab.12 for ; Fri, 18 Jul 2014 06:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=536ixc+nfAdoZW7wVFRk/HG8+/SQuSsBpn7APhZ8twg=; b=sJpId+CS4o7R5QlJ831u25yyMil3qBLN6VfmlcEZ54KKyj+xvC0uxS5U43AP2k/mrI wjYISZstlNjBbEB7ft8Bedw9CLzNDU6blMlJEIVLbMpF+B2httZhRZN04+Dv/T/2s8rq aZ1oy7SSz/2+FVbo3J6HS28XOiltr1qhG8Khc4w3xr5eClh+JaC/Bi8t2GqDkphlKQ9/ 4teZHQlK91P1CKhuCtOOWye3oM82f5XNaMi/lDLW2XabqlQg6lLreq32t8MJkHuicUtH sXIs8wL1CzKLaY9mBTijkcGvmAiR0afmJF9qJqp/ODJf4AvxRIzwRJzEbaLof5PiYXQl 4iaA== X-Received: by 10.112.161.72 with SMTP id xq8mr5065128lbb.18.1405691507812; Fri, 18 Jul 2014 06:51:47 -0700 (PDT) Original-Received: by 10.114.18.44 with HTTP; Fri, 18 Jul 2014 06:51:47 -0700 (PDT) X-Google-Sender-Auth: XVydsOXoFg5EMJv7GffMl-XlxU0 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:91637 Archived-At: I'm trying to use the ipython shell from within emacs. To do so I've followed the instructions at the top of python.el and added the following code to my .emacs: (setq python-shell-interpreter "C:/Anaconda/python.exe" python-shell-interpreter-args "-i C:/Anaconda/Scripts/ipython-script.py console --matplotlib=qt" python-shell-prompt-regexp "In \\[[0-9]+\\]: " python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " python-shell-completion-setup-code "from IPython.core.completerlib import module_completion" python-shell-completion-module-string-code "';'.join(module_completion('''%s'''))\n" python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n") When I execute (M-x) run-python, SOMETIMES the session does not initialize properly and the new buffer looks like this: ----------------------------------------------------------- Python 2.7.6 |Anaconda 2.0.1 (64-bit)| (default, Nov 11 2013, 10:49:15) [MSC v.1500 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information. IPython 2.1.0 -- An enhanced Interactive Python. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://binstar.org ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: ----------------------------------------------------------- The difference compared to the situation when everything is well, is that here I only see "In [1]:", while normally I should see 4 empty input prompts, with the last one reading "In [4]". When I execute any command such as "1+1" and press RET, nothing happens. This happens starting emacs with the -Q option and executing the ipython customization in the *scratch* buffer. By running the debugger I've found out that emacs sends some commands to the inferior python shell with (comint-send-string ...) and tries to hide them from the user. That appears to be the reason for the four empty prompts. Looking at the running processes I've noted that there are 2 python processes running. The task manager reports one as: c:\Anaconda\python.exe -c"from IPython.kernel.zmq.kernelapp import main; main()" -f C:\Users\beffa\.ipython\profile_default\security\kernel-976.json --matplotlib=qt --IPKernelApp.parent_appname='ipython-console' --interrupt=692 --parent=696 (Obviously the value of the last two arguments change everytime.) If I kill this process, the inferior python shell asks: "kernel died, restart ([y]/n)? kernel died, restart ([y]/n)? kernel died, restart ([y]/n)?" If I press y the process is restarted and the inferior python shell works fine (or at least responds to the commands like 1+1 that I've tried). I would greatly appreciate any suggestion on how to further dig into debugging and solve this intermittent problem. Thank you in advance for your help. Fede 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: ENU locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: show-paren-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: C-x C-r C-SPC C-a C-w c : / p r o SPC SPC e m 3 s i s i d f C-SPC M-w C-x b C-y M-x s h o w - p a C-x C-e M-x r u n - p y C-x k y e s C-x 0 M-x r u n - p y C-x o M-x r e p o r Recent messages: "';'.join(get_ipython().Completer.all_completions('''%s''')) " Sent python-shell-completion-setup-code Sent python-ffap-setup-code Sent python-eldoc-setup-code Making completion list... Sent python-shell-completion-setup-code Sent python-ffap-setup-code Sent python-eldoc-setup-code Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode compile python rx easymenu comint ring ansi-color cus-start cus-load paren 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)