[python-win32] Exception whilst using pySerial & Win32

howard at eegsoftware.com howard at eegsoftware.com
Mon Oct 22 07:10:45 CEST 2007


<snip> 
> occasionally I get an exception raised (win32file.EscapeCommFunction (self.hCommPort, 
> win32file.SETDTR), pywintypes.error : (5, 'EscapeCommFunction', 'Access is Denied') ) From 
> what I can gather, this exception is raised when the resource in question (in this case my serial 
> port) if already in use by another entity. Now that's fine, but no other process / application on the 
> machine is (to the best of my knowledge) accessing this serial port. My application is single 
> threaded. 
<snip>

I have had weird things happen if "somehow" Windows decides to turn on DTR handshaking 
when I am using a serial port (again with nobody else using the port).   Try reading the status 
of DTR handshaking when you get the error and see if something toggled it on.  I know you 
get some kind of error (but memory escapes me ...) setting/clearing DTR if handshaking is 
on.





More information about the python-win32 mailing list