title: STM32 - can't open serial port from pyserial, but can from ST-Link
body: <p>I'm working with STM32 (NUCLEO-L476RG) - uploading code via Workbench, sometimes using ST-Link Utility to connect to it.
  Additionally, I've some python code that listens to STM via serial port.</p>
  
  <p>Till yesterday everything was working fine, but today (without changing anything connected to STM, drivers etc.) <strong>pyserial can't connect to the device</strong>, showing message:</p>
  
  <p><code>File "C:\python37\lib\site-packages\serial\serialwin32.py", line 62, in open raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
  serial.serialutil.SerialException: could not open port 'COM7': FileNotFoundError(2, 'Nie można odnaleźć określonego pliku.', None, 2)
  </code></p>
  
  <p><strong>I can upload code using Workbench or connect to STM via ST-Link Utility without any problems. Port is not used by any other application.</strong></p>
  
  <p>When I list ports by <code>serial.tools.list_ports.comports()</code> it shows properly as <code>STMicroelectronics STLink Virtual COM Port (COM7)</code>.</p>
  
  <p>In 'Device Manager' there's a yellow triangle next to the COM, but I'm not sure if it were there earlier (probably yes) - it says that the device driver is not signed. </p>
  
  <p><img src="https://i.imgur.com/yGRHWWw.png" alt="device"></p>
  
  <p>I tried to:</p>
  
  <ul>
  <li>reinstall the drivers to these provided by STM</li>
  <li>reinstall pyserial</li>
  <li>use older python</li>
  <li>use older pyserial</li>
  <li>change COM to another</li>
  <li>change cable to new one</li>
  <li>connect the device to all possible USB ports</li>
  </ul>
  
  <p>but any of that changed anything.</p>
  
  <p>My setup:</p>
  
  <ul>
  <li>Windows 7</li>
  <li>python 3.7.1</li>
  <li>pyserial 3.4</li>
  <li>STM 32 NUCLEO-L476RG</li>
  <li>System Workbench for STM32 &amp; ST-Link Utility, which are working perfectly fine</li>
  </ul>
  
  <p>This setup was working for half a year (!) and I didn't change anything connected to it in the last couple of days. Only thing I did yesterday was installing PostgreSQL, but it seems highly unbelievable that it could cause my current problem...</p>
  
  <p>Thank you in advance for any help - I don't really have an idea what should I try next, so I appreciate any piece of advice.</p>