My guess is when I'm trying to open the port that has already been opened, Serial flag an error on that port that causes "Access Denied". I ran the script with Administrator privileged and got the same exception "Access Denied".Īlso I don't think it's a privilege problem since the first open on line 11 works fine without any error or exception. I still get an exception "Access Denied" on line 20 which is port.open(). I tried this code (As you said close the port in exception): from serial import Serial, SerialException I also tried to destroy the object and create it again and I got the same error.ĭoes any know if this is a bug or am I doing something wrong. So somehow try and except to open the already opened port messed up the object. I checked the port with Portmon while I was running that script to make sure that the port gets closed and it is. Python 2.7.1 (I know it's a bit old :-)) from serial import Serial, SerialExceptionĮrror that I'm getting is: could not open port COM4: Access is denied. PySerial-2.5.win32 (Installed from binary) I don't know if this is a bug from PySerial library or I'm doing something totally stupid :-) I'm trying to use PySerial and I'm getting "Access Denied".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |