[issue24837] await process.wait() does not work with a new_event_loop

2022-03-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay let's close it then. :-)

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24837] await process.wait() does not work with a new_event_loop

2022-03-30 Thread Kumar Aditya


Kumar Aditya  added the comment:

@asvetlov This is bug no longer exists, on main branch this is the output and 
it does not hangs:

DEBUG:asyncio:Using selector: EpollSelector
True

--
nosy: +asvetlov, kumaraditya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24837] await process.wait() does not work with a new_event_loop

2016-09-04 Thread Justin Mayfield

Justin Mayfield added the comment:

I agree with Guido.  I spent a couple hours trying to debug some of my own code 
that turned out to be this issue.  My use case is single threaded too.

Perhaps I'm daft but I don't understand why the child watcher is part of the 
event loop policy.  At first glance it appears that it would be better suited 
being attached to any event loop in the main thread and then this wouldn't be 
an issue.

I wonder if this design is intended to support launching subprocesses from 
non-main thread event loops, which seems inherently dangerous and potentially 
misguided to me.

--
nosy: +Justin Mayfield

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24837] await process.wait() does not work with a new_event_loop

2015-08-10 Thread Guido van Rossum

Guido van Rossum added the comment:

I think it's unfortunate that this doesn't work. Note that the example program 
has no threads -- it just has a loop that isn't the default loop. The docs you 
refer to aren't very helpful.

--

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



[issue24837] await process.wait() does not work with a new_event_loop

2015-08-10 Thread Chetan Reddy

New submission from Chetan Reddy:

Attached test.py hangs with the following output when run with 
PYTHONASYNCIODEBUG1= and -Wdefault.

DEBUG:asyncio:Using selector: EpollSelector
DEBUG:asyncio:run shell command 'sleep 2'
DEBUG:asyncio:process 'sleep 2' created: pid 13801
INFO:asyncio:run shell command 'sleep 2': _UnixSubprocessTransport pid=13801 
running

After i Ctrl-C it, i see the following traceback (paths edited)

^CTraceback (most recent call last):
  File /chetan/test.py, line 17, in module
main()
  File /chetan/test.py, line 12, in main
result =loop.run_until_complete(sleepWithShell(loop))
  File /Python-3.5.0b4-clang/lib/python3.5/asyncio/base_events.py, line 329, 
in run_until_complete
self.run_forever()
  File /Python-3.5.0b4-clang/lib/python3.5/asyncio/base_events.py, line 300, 
in run_forever
self._run_once()
  File /Python-3.5.0b4-clang/lib/python3.5/asyncio/base_events.py, line 1142, 
in _run_once
event_list = self._selector.select(timeout)
  File /Python-3.5.0b4-clang/lib/python3.5/selectors.py, line 432, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
/Python-3.5.0b4-clang/lib/python3.5/asyncio/base_subprocess.py:117: 
ResourceWarning: unclosed transport _UnixSubprocessTransport pid=13801 running
/Python-3.5.0b4-clang/lib/python3.5/asyncio/base_events.py:384: 
ResourceWarning: unclosed event loop _UnixSelectorEventLoop running=False 
closed=False debug=True
DEBUG:asyncio:Close _UnixSelectorEventLoop running=False closed=False 
debug=True

--
components: asyncio
files: test.py
messages: 248353
nosy: chetan, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: await process.wait() does not work with a new_event_loop
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file40155/test.py

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



[issue24837] await process.wait() does not work with a new_event_loop

2015-08-10 Thread STINNER Victor

STINNER Victor added the comment:

It's better to use asyncio.get_event_loop() to create the event loop.
Otherwise, you have to create manually the child watcher:
https://docs.python.org/dev/library/asyncio-subprocess.html#subprocess-and-threads

If I recall correctly, you have to call asyncio. get_child_watcher().

What is your OS?

Maybe subprocess_exec/shell may ensure that a child watcher exist. Maybe
only in debug mode?

--

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