Mailing List Archive

NT
Hi,

another problem under NT: I'd like to message the user a longer description about the
programm with sys.stdout.write(usagetxt).
The user should have possibility to pipe the output like he
wants, e.g. with 'less' or 'more'.
But I get an error:

C:\myPython>installation15.py /? |more
Traceback (innermost last):
File "C:\myPython\installation15.py", line 642, in ?
switcher()
File "C:\myPython\installation15.py", line 629, in switcher
__usage()
File "C:\myPython\installation15.py", line 189, in __usage
sys.stdout.write(usagetxt)
IOError: [Errno 9] Bad file descriptor

If I start with 'C:\myPython>python installation15.py /? |more'
there's no problem and it works allright.

I've read the messages about NT and piping in this group, but I think
it's something differnt, ouh?!

hand (='have a nice day'!),
Holger
NT [ In reply to ]
Holger Jannsen wrote in message
<376A6D64.DF881D27@phoenix-edv.netzservice.de>...

>C:\myPython>installation15.py /? |more
>Traceback (innermost last):
...

>If I start with 'C:\myPython>python installation15.py /? |more'
>there's no problem and it works allright.

This is a known bug with the NT command processor. Every application has
this problem, not just Python.

Mark.
NT [ In reply to ]
No, you've got it right. When you use the file association for some unknown
reason you can't use redirection.
If you just do: "python blah.py < blah > blah2" everything works perfectly.

My current theory is that there is a design point/bug in the file
association code that we just don't understand at the momemnt.

Bill

> -----Original Message-----
> From: Holger Jannsen [mailto:holger@phoenix-edv.netzservice.de]
> Sent: Friday, June 18, 1999 9:02 AM
> To: python-list@cwi.nl
> Subject: NT
>
>
> Hi,
>
> another problem under NT: I'd like to message the user a
> longer description about the
> programm with sys.stdout.write(usagetxt).
> The user should have possibility to pipe the output like he
> wants, e.g. with 'less' or 'more'.
> But I get an error:
>
> C:\myPython>installation15.py /? |more
> Traceback (innermost last):
> File "C:\myPython\installation15.py", line 642, in ?
> switcher()
> File "C:\myPython\installation15.py", line 629, in switcher
> __usage()
> File "C:\myPython\installation15.py", line 189, in __usage
> sys.stdout.write(usagetxt)
> IOError: [Errno 9] Bad file descriptor
>
> If I start with 'C:\myPython>python installation15.py /? |more'
> there's no problem and it works allright.
>
> I've read the messages about NT and piping in this group, but I think
> it's something differnt, ouh?!
>
> hand (='have a nice day'!),
> Holger
>