title: SerialException: could not open port (Access is denied)
body: <p>I am writing Python v2.x in Windows7 OS. When I run my code, the following error happens frequently.</p>
  
  <pre><code>serial.serialutil.SerialException: could not open port 'COM4': WindowsError(5, 'Access is denied.')
  </code></pre>
  
  <p>Here are what I did:</p>
  
  <p>1) I check device manager, <code>COM 4</code> can be seen, but cannot open</p>
  
  <p>2) In my code, I do close <code>COM</code> port after using it</p>
  
  <p>3) Here is <code>COM</code> config in my code: <code>ser = serial.Serial( "COM4", 9600, timeout=0.05)</code></p>
  
  <p>4) I reboot computer, the problem is gone, but it happens again after a while</p>
  
  <p>5) I wonder it is a problem related to my Python code or Windows system?</p>
  
  <p>So considering above fact, could anyone help me out? Thanks and Happy New Year! </p>
  
  <p>=)</p>