Page 1 of 1

Windows 7 64 cmd stdout exception

Posted: 02 Feb 2010, 19:16
by ramarik
CMD shell started from Altap Salamander does not provide a proper file descriptors (stdout).

I wrote a small Python script test.py containing just the following two lines:
for i in range(100):
  print "hello"
If the script is executed from the command shell started by Windows 7 one can see the following replies:
>D:\tmp>python test.py > d:\tmp\blb.txt
>
>D:\tmp>test.py > d:\tmp\blb.txt
>

However, if the command shell is started through Altap Salamander, then the replies are like this:
>D:\tmp>python test.py > d:\tmp\blb.txt
>
>D:\tmp>test.py > d:\tmp\blb.txt
>close failed in file object destructor:
>Error in sys.excepthook:
>
>Original exception was:
>

">" at the beginning of lines were added by me to highlight the sessions.
The environment:
-Windows 7 64 bit Ultimate
-Python 2.6.2 32 bit
-Altap Salamander 2.52
I noticed different environment variable setting in the CMD shells:

CMD Windows 7:
CommonProgramFiles=C:\Program Files\Common Files
ProgramFiles=C:\Program Files

CMD Salamander:
CommonProgramFiles=C:\Program Files (x86)\Common Files
ProgramFiles=C:\Program Files (x86)

I would guess it deals with file type association, its related mechanism of execution, and mixing 32 and 64 bit environments.

Any clue what is going on?

Thank you
Radek

Re: Windows 7 64 cmd stdout exception

Posted: 02 Feb 2010, 21:01
by Jan Rysavy
Please search this forum for x64 and redirector words for explanation of this problem.

Re: Windows 7 64 cmd stdout exception

Posted: 02 Feb 2010, 21:12
by Ether
Jan Rysavy wrote:Please search this forum for x64 and redirector words for explanation of this problem.
I'm not sure that's the source of the problem.

Re: Windows 7 64 cmd stdout exception

Posted: 02 Feb 2010, 23:17
by SelfMan
Its a timing related issue. A pipe/redirector must be closed before the end which does not happen.

Read this thread for atleast a partial solution: http://bugs.python.org/issue4192