stdin, stdout, redmon

Thynnus thynnus at
Tue Jan 22 17:33:48 CET 2008

On 1/22/2008 8:54 AM, Konstantin Shaposhnikov wrote:
> Hi,
> This is Windows bug that is described here:
> This article also contains solution: you need to add registry value:
> HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies
> \Explorer
> InheritConsoleHandles = 1 (REG_DWORD type)
> Do not forget to launch new console (cmd.exe) after editing registry.
> Alternatively you can use following command
>   cat file | python
> instead of
>   cat file | python
> Regards,
> Konstantin

Nice one, Konstantin!

I can confirm that adding the registry key solves the problem on XPsp2:

-----After adding InheritConsoleHandles DWORD 1 key-----
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

D:\temp>type |
['import sys\n', '\n', 'print sys.stdin.readlines ()\n']


The KB article is quite poorly written. Even though it seems to state that 
issue was 'solved for win2k with sp4, for XP with sp1', and gives no indication 
that the key is needed after the sp's are applied *even though* it is in fact 
necessary to the solution.

     -Any side effects to look out for?
     -If the change is relatively benign, should it be part of the install?
     -Is this worth a documentation patch? If yes to where, and I'll give it a 


More information about the Python-list mailing list