[issue16734] Delay interpreter startup phase until script is read

2012-12-20 Thread Charles-François Natali

Charles-François Natali added the comment:

I may be missing something, but nothing's wrong here.
When you start a subprocess, the child process keeps running (in background).

If you want to wait for its termination, just use p.wait() or p.communicate().

--
nosy: +neologix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16734
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16734] Delay interpreter startup phase until script is read

2012-12-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You should use some kind of inter-process communication to synchronize your 
processes.

In particular, for get rid of a temporary script file you can either send 
script via pipe:

p = Popen([sys.executable], stdin=PIPE)
p.stdin.write(longscript)

or use it as a program argument:

p = Popen([sys.executable, '-c', longscript])

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16734
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16734] Delay interpreter startup phase until script is read

2012-12-20 Thread Christian Heimes

Christian Heimes added the comment:

That's the way fork() and the subprocess module work. Please follow Serhiy's 
advice.

--
nosy: +christian.heimes
resolution:  - rejected
stage:  - committed/rejected
status: open - closed
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16734
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16734] Delay interpreter startup phase until script is read

2012-12-19 Thread anatoly techtonik

New submission from anatoly techtonik:

Currently, when interpreter is launched it returns immediately to parent 
process without waiting to read the entrypoint script. This causes problem when 
you need to remove this script after executing.

Is it possible to delay return to child process until the entrypoint script is 
read?

See test case in attach.

--
components: Interpreter Core
files: sub_race_removal.py
messages: 177800
nosy: techtonik
priority: normal
severity: normal
status: open
title: Delay interpreter startup phase until script is read
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5
Added file: http://bugs.python.org/file28375/sub_race_removal.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16734
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com