Menu

#182 Fails on Windows 64-bit: "The handle is invalid"

v2.7
closed-invalid
None
5
2015-08-04
2015-04-07
John Nagle
No

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>

Discussion

  • John Nagle

    John Nagle - 2015-04-07

    Disregard; was using old version of pyserial left from 32-bit Python install.

     
  • Chris Liechti

    Chris Liechti - 2015-08-04
    • status: open --> closed-invalid
    • assigned_to: Chris Liechti
    • Group: v1.0 (example) --> v2.7
     

Log in to post a comment.