-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached #353
Comments
I've taken a look at this. This problem is a bit out of scope of #351 I think. As #351 has to do with how asyncio interacts with the python 3.5 interpreter, whereas this at first glance looks like it has more to do with the way asyncio interacts with threading. Does this work in later versions of the interpreter? Have you tried it for example on python 3.7? |
Thanks for taking the time to! I'm unfamiliar with the asyncio module so couldn't really look at it myself. I haven't run this exact setup on python 3.7 but I only noticed it after I switched to 3.5. |
What did you switch to 3.5 from? 2.7? Did it work in your previous setup? |
I have run into this exact same problem. Was there ever a workaround identified? |
A little more research reveals that a thread needs to have it's own event loop. In my case I wanted to run websockets on one end and a LiveCapture on the other. By letting pyshark's LiveCapture have the main context's event loop and doing the following within a thread on the websocket side it all works correctly.
|
Hey there! I have the same exact problem. I am running my pyshark.LiveCapture("pcap file") function under a QThread class for Pyside2. QThread creates an event loop when the run() function is called. It works perfectly for Windows 10 OS but not in Ubuntu 16.04. It throws the above mentioned error Even after implementing @cmacfarl additional snippet of code, it still throws the same error. How do i solve this? |
Do you have solution now? I'm having the same problem :(( |
I get this error any time I try run a
LiveCapture
within a thread. Here is a minimal reproducible example:This produces the following stack trace:
I'm using python3.5 on a Raspberry Pi 3B+ with Raspbian 9 (Stretch). Using pyshark version 0.4.2.4
The text was updated successfully, but these errors were encountered: