[pywin32-bugs] [ pywin32-Bugs-1655517 ] PeekNamedPipe returning "Invalid Handle"
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2007-02-08 23:55:21
|
Bugs item #1655517, was opened at 2007-02-09 07:40 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1655517&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: joshua_benuck (some_guy_coding) Assigned to: Nobody/Anonymous (nobody) Summary: PeekNamedPipe returning "Invalid Handle" Initial Comment: Using the following program: import win32api import win32pipe if __name__ == "__main__": pipe = win32api.GetStdHandle(win32api.STD_INPUT_HANDLE) buffer, bytesToRead, result = win32pipe.PeekNamedPipe(pipe, 1) on a Windows XP Professional machine. Running Python 2.5 and build 210 of the win32all installer yields this error message: Traceback (most recent call last): File "in.py", line 6, in <module> buffer, bytesToRead, result = win32pipe.PeekNamedPipe(pipe, 1) pywintypes.error: (6, 'PeekNamedPipe', 'The handle is invalid.') Is this expected? If it is, how would I go about querying the standard input to see if there is any data waiting? ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2007-02-09 10:55 Message: Logged In: YES user_id=14198 Originator: NO I'm afraid this is just a question about Windows itself and not related to pywin32. I'd suggest either mailing the pyt...@py... mailing list, or searching beyond the Python community to see how a C based program would achieve what you want directly via win32 - it will then be trivial to use that technique using pywin32. ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2007-02-09 10:46 Message: Logged In: YES user_id=771074 Originator: NO Console handles won't work with the named pipe functions. You can use the win32console module to check std input. import win32console cb=win32console.PyConsoleScreenBufferType(pipe) if cb.PeekConsoleInput(1) ... Roger Roger ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1655517&group_id=78018 |