Serial port gotcha with win32all

Markus Demleitner msdemlei at tucana.cl.uni-heidelberg.de
Fri Oct 19 02:51:59 EDT 2001


Hi,

I'm getting increasingly desperate.  All I'm trying to do is
attach a little serial gizmo that runs just fine when talked
to from a linux box (using some homegrown python software) to
a machine plagued by Windows 2000.

Realizing that termios doesn't buy me much in win32, I soon
ran across uspp which basically acts as a wrapper around the
win32all or termios modules on the respective platforms.

Under linux, uspp worked quite as well as my own termios-based
code (perhaps not too surprisingly).  Under win32, however,
write()s seem to work but read()s consistently fail with a
"incorrect paramater" exception in a call to win32file.ReadFile.

Now, clearly the OpenFile succeded, and the handle didn't change
between the open and the read, the error is not in the number
of bytes to read (passing some weird object there causes a
ParameterError, as expected), and in general I've not been
able to gain any clue as to what is going on.  The win32all
sources seem somewhat intimidating, at least for me with
no knowledge of the win32 API whatsoever.

So -- can anyone give me a hint where to start getting a
grip on this one?

Thanks,

      Markus




More information about the Python-list mailing list