Fails on Windows 7, 64-bit, Python 2.7.9/64 bit, with message "The handle is invalid" on the first write or read.
Other reports of this problem:
http://stackoverflow.com/questions/3028786/how-can-i-fix-error-6-the-handle-is-invalid-with-pyserial
Reproduce by:
C:\Users\nagle>python
Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import serial
ser = serial.Serial(0)
ser.write("Hello")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 255, in write
raise SerialException("WriteFile failed (%s)" % ctypes.WinError())
serial.serialutil.SerialException: WriteFile failed ([Error 6] The handle is invalid.)
</module></stdin>
Disregard; was using old version of pyserial left from 32-bit Python install.