unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
@ 2014-04-29 12:11 Andy Moreton
  2014-04-29 13:40 ` Glenn Morris
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andy Moreton @ 2014-04-29 12:11 UTC (permalink / raw)
  To: 17370

Load a file containing python code, in a file with extension ".py". This
will use python-mode as the major mode, which immediately runs an
inferior python executable.

I did not ask for a python interpreter, and do not want one running - I
just want to visit a file containing python code. There is not any
obvious way of disabling this behaviour.

Emacs should not run an arbitrary executable without explicit user
configuration to enable it.



In GNU Emacs 24.3.90.7 (i686-pc-mingw32)
  of 2014-04-29 on AJM-DESKTOP
Repository revision: 117027 
monnier@iro.umontreal.ca-20140429041427-c1v4orr7y23btoh2
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
  `configure --prefix=/c/emacs-emacs-24
  --with-pkg-config-prog=/c/emacs/mingw-devel/pkg-config-0.26-1/bin/pkg-config.exe
  --enable-checking PKG_CONFIG_PATH=/c/emacs/mingw-devel/lib/pkgconfig
  'CPPFLAGS= -I/c/emacs/mingw-devel/include
  -I/c/emacs/mingw-devel/src/xpm/3.5.1/libXpm-3.5.1-src/lib' 'CFLAGS= -O0
  -g3' 'LDFLAGS= -L/c/emacs/mingw-devel/lib''






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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-04-29 12:11 bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited Andy Moreton
@ 2014-04-29 13:40 ` Glenn Morris
  2014-04-29 14:12 ` Stefan Monnier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2014-04-29 13:40 UTC (permalink / raw)
  To: Andy Moreton; +Cc: 17370

Andy Moreton wrote:

> Load a file containing python code, in a file with extension ".py". This
> will use python-mode as the major mode, which immediately runs an
> inferior python executable.

I cannot reproduce this. Does it happen with emacs -Q?





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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-04-29 12:11 bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited Andy Moreton
  2014-04-29 13:40 ` Glenn Morris
@ 2014-04-29 14:12 ` Stefan Monnier
  2014-04-29 15:06   ` Andy Moreton
  2014-04-29 14:28 ` Andreas Röhler
  2014-07-19 13:28 ` bug#17370: python-shell-internal-send-string can hang if you change your python prompt Fabián Ezequiel Gallina
  3 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2014-04-29 14:12 UTC (permalink / raw)
  To: Andy Moreton; +Cc: 17370

> Load a file containing python code, in a file with extension ".py". This
> will use python-mode as the major mode, which immediately runs an
> inferior python executable.

I do not see that.  Can you provide a recipe for that?


        Stefan





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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-04-29 12:11 bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited Andy Moreton
  2014-04-29 13:40 ` Glenn Morris
  2014-04-29 14:12 ` Stefan Monnier
@ 2014-04-29 14:28 ` Andreas Röhler
  2014-07-19 13:28 ` bug#17370: python-shell-internal-send-string can hang if you change your python prompt Fabián Ezequiel Gallina
  3 siblings, 0 replies; 9+ messages in thread
From: Andreas Röhler @ 2014-04-29 14:28 UTC (permalink / raw)
  To: 17370

On 29.04.2014 14:11, Andy Moreton wrote:
> Load a file containing python code, in a file with extension ".py". This
> will use python-mode as the major mode, which immediately runs an
> inferior python executable.
>
> I did not ask for a python interpreter, and do not want one running - I
> just want to visit a file containing python code. There is not any
> obvious way of disabling this behaviour.
>
> Emacs should not run an arbitrary executable without explicit user
> configuration to enable it.
>
>

Reads you installed one of the IDE's around.
Should not happen when starting from emacs -Q






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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-04-29 14:12 ` Stefan Monnier
@ 2014-04-29 15:06   ` Andy Moreton
  2014-05-02 20:10     ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Moreton @ 2014-04-29 15:06 UTC (permalink / raw)
  To: 17370

On Tue 29 Apr 2014, Stefan Monnier wrote:

>> Load a file containing python code, in a file with extension ".py". This
>> will use python-mode as the major mode, which immediately runs an
>> inferior python executable.
>
> I do not see that.  Can you provide a recipe for that?
>
>
>         Stefan

It seems that the problem is caused by this in my .emacs:
    (global-ede-mode 1)
    (ede-enable-generic-projects)

Some combination of the two causes emacs to load an inferior python and
then run at 100% cpu for approx 30-40 seconds.

As the EDE stuff was only there for experimenting with EDE and Semantic,
so I'll remove it (fixing the Semantic/EDE docs to be useful is another
story).

    AndyM






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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-04-29 15:06   ` Andy Moreton
@ 2014-05-02 20:10     ` Glenn Morris
  2014-05-02 20:56       ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2014-05-02 20:10 UTC (permalink / raw)
  To: Andy Moreton; +Cc: 17370, Fabian Ezequiel Gallina


The issue seems to be that semantic-python-get-system-include-path runs
some code to get the Python system include path (IMO this is a
reasonable thing for it to do and I don't see the need to have an option
controlling this).

This calls:

(python-shell-internal-send-string "import sys;print ('\\n'.join(sys.path))")

It is this that hangs (in python-shell-send-string-no-output AFAICS).
It also hangs in Emacs 24.3.

emacs -Q -l python

and evaluate the above.





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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-05-02 20:10     ` Glenn Morris
@ 2014-05-02 20:56       ` Glenn Morris
  2014-06-15 17:12         ` Fabián Ezequiel Gallina
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2014-05-02 20:56 UTC (permalink / raw)
  To: Andy Moreton; +Cc: 17370, Fabian Ezequiel Gallina

Glenn Morris wrote:

> (python-shell-internal-send-string "import sys;print ('\\n'.join(sys.path))")
>
> It is this that hangs (in python-shell-send-string-no-output AFAICS).
> It also hangs in Emacs 24.3.
>
> emacs -Q -l python

It seems that for me the hang is because I have customized my python
prompt (sys.ps1 = 'py> ' in ~/.pythonrc.py).

I have to set python-shell-prompt-regexp to match to avoid a hang as
python.el thinks it needs to keep waiting for process output.

Can python.el be made more robust in this regard?

Otherwise there needs to be a big fat warning attached to
python-shell-prompt-regexp.





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

* bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited
  2014-05-02 20:56       ` Glenn Morris
@ 2014-06-15 17:12         ` Fabián Ezequiel Gallina
  0 siblings, 0 replies; 9+ messages in thread
From: Fabián Ezequiel Gallina @ 2014-06-15 17:12 UTC (permalink / raw)
  To: Glenn Morris, 17370

Glenn Morris <rgm@gnu.org> writes:

> Glenn Morris wrote:
>
>> (python-shell-internal-send-string "import sys;print ('\\n'.join(sys.path))")
>>
>> It is this that hangs (in python-shell-send-string-no-output AFAICS).
>> It also hangs in Emacs 24.3.
>>
>> emacs -Q -l python
>
> It seems that for me the hang is because I have customized my python
> prompt (sys.ps1 = 'py> ' in ~/.pythonrc.py).
>
> I have to set python-shell-prompt-regexp to match to avoid a hang as
> python.el thinks it needs to keep waiting for process output.
>
> Can python.el be made more robust in this regard?
>
> Otherwise there needs to be a big fat warning attached to
> python-shell-prompt-regexp.
>
>
>
>

We definitely can do better.

One way would be to set the prompt regexp dynamically using the values
of sys.ps1 and sys.ps2. But then we also need to be careful as those
values for ipython are a lie:

    $ ipython
    Python 2.7.6 (default, Mar 22 2014, 22:59:56)
    Type "copyright", "credits" or "license" for more information.

    IPython 1.2.1 -- An enhanced Interactive Python.
    ?         -> 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]: import sys

    In [2]: sys.ps1
    Out[2]: 'In : '

Perhaps the best way to go is a mixture of the current way and
dinamically expanding `python-shell-prompt-regexp` with sys.ps1 and
sys.ps2. I'll give it a try in the next few weeks and follow up once I
see how it goes.


    Fabián





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

* bug#17370: python-shell-internal-send-string can hang if you change your python prompt
  2014-04-29 12:11 bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited Andy Moreton
                   ` (2 preceding siblings ...)
  2014-04-29 14:28 ` Andreas Röhler
@ 2014-07-19 13:28 ` Fabián Ezequiel Gallina
  3 siblings, 0 replies; 9+ messages in thread
From: Fabián Ezequiel Gallina @ 2014-07-19 13:28 UTC (permalink / raw)
  To: 17370-done


Fixed in the emacs-24 branch at revno 117387.



Cheers,
Fabián





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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29 12:11 bug#17370: 24.3.90; user cannot disable inferior python run from python-mode when file is visited Andy Moreton
2014-04-29 13:40 ` Glenn Morris
2014-04-29 14:12 ` Stefan Monnier
2014-04-29 15:06   ` Andy Moreton
2014-05-02 20:10     ` Glenn Morris
2014-05-02 20:56       ` Glenn Morris
2014-06-15 17:12         ` Fabián Ezequiel Gallina
2014-04-29 14:28 ` Andreas Röhler
2014-07-19 13:28 ` bug#17370: python-shell-internal-send-string can hang if you change your python prompt 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).