nradulovic / pyeds

Python Event Driven System
GNU Lesser General Public License v3.0
11 stars 4 forks source link

A strange error message #11

Closed jfongattw closed 4 years ago

jfongattw commented 4 years ago

I have a top level function main() something like this, it was called when script starts:

def main(input_str): for c in input_str: ... pfsm.send(achar) time.sleep(0.01) ....

where pfsm is state machine, achar is an event. It runs correctly.

when the line of the sleep() was comment out, I get a strange error:

Fatal Python error: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads

Thread 0x000017c4 (most recent call first): File "parser_pyeds.py", line 136 in on_entry File "D:\Works\Python\pyeds-master\src\pyeds\fsm.py", line 369 in execute File "D:\Works\Python\pyeds-master\src\pyeds\fsm.py", line 399 in _exec_state File "D:\Works\Python\pyeds-master\src\pyeds\fsm.py", line 431 in _dispatch File "D:\Works\Python\pyeds-master\src\pyeds\fsm.py", line 496 in event_loop File "C:\Python34\lib\threading.py", line 859 in run File "C:\Python34\lib\threading.py", line 911 in _bootstrap_inner File "C:\Python34\lib\threading.py", line 879 in _bootstrap

Current thread 0x00001134 (most recent call first):

What to do?

Best Regards, Jach

nradulovic commented 4 years ago

Hello,

Thanks for feedback. Sorry for late reply, I had a few personal things to attend to.

As for the error, is your application terminating some time after sending the event to pfsm?

Best regards, Nenad

nradulovic commented 4 years ago

Since I have had a second look at this issue it seems to me it is somehow related to shut-down while the state machine is still being executed. Since this is an old issue and you probably have already fix it by now I'm closing this issue. If you still have the problem and/or have the will to still correct the issue please feel free to open a new issue. Thanks!