Closed kakyoism closed 4 years ago
Hi kakyoism, thanks for the feedback! Indeed the SelectorEventLoop provided as the default implementation on all platforms does not support subprocesses on Windows.
Since the default will be switched to ProactorEventLoop in 3.8, I think it's fair to backport this behavior to older Python versions.
I'll publish a patch release with this fix, thank you!
For those who use Python < 3.7. I tested on 3.6, but it should work on 3.5.
class WaapiClient(UnsubscribeHandler):
def __init__(self, url=None, allow_exception=False):
...
if sys.platform == 'win32':
asyncio.set_event_loop(asyncio.ProactorEventLoop())
self._loop = asyncio.get_event_loop()
...
Thanks for the awesome
waapi-client
. It makes coding using WAAPI a breeze.I recently bumped into this issue: when calling a WAAPI script through
subprocess
, the child process will never end.I've fixed it locally by referring to this post: https://stackoverflow.com/questions/44633458/why-am-i-getting-notimplementederror-with-async-and-await-on-windows
For py3.7+, we only need a one-liner in
client.py
:Hope this helps!