pySerial Windows write problem

Bob Greschke bob at
Fri Jul 29 01:00:11 CEST 2005

"Peter Hansen" <peter at> wrote in message 
news:rfCdnZHOGsnDwXTfRVn-gg at
> Bob Greschke wrote:
> > But writing anything to the port
>> quickly (not always right maybe 5-6 iterations through the 
>> loop?) causes the
>>     win32file.CloseHandle(self.hComPort)
>> statement in the 'def close(self)' function of the file of 
>> the pySerial package to hang for a few seconds, then return.
> Are you certain it is this line that is blocking, and not the preceding 
> line which is a call to SetCommTimeouts()?  How did you prove which line 
> it is?  (I don't have an answer to the problem, just wanted to be sure of 
> the information...)
> -Peter


I had the SetCommTimeouts line commented out.  I just have a couple of 
prints before and after the CloseHandle line.

I didn't write the C++ program, but it looks like it never closes the serial 
port.  It opens it when it starts up, then keeps it open until it quits. 
Tsk tsk tsk.  Sloppy.  Maybe they did that to cover up this problem. :)


More information about the Python-list mailing list