471,347 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,347 software developers and data experts.

serial readline thread IO Error (9, 'Bad file descriptor')

How can I close a thread that is waiting on a file/port down
gracefully, and not have an IO error pop up?

I am having trouble closing a thread that is listening to the serial
port. I have a thread that calls uses a pySerial serial port and calls
readline() without a timeout, which is blocking. When I am shutting
down the application I close the serial port, which causes the IO
error: (9, 'Bad file descriptor'). It makes sense that we would get
this error, because it is trying to read off of a closed 'file'. Is
there a better way to close this thread and port down?


Jun 19 '07 #1
0 1813

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by lynology | last post: by
7 posts views Thread by news | last post: by
5 posts views Thread by rajiv07 | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.