Author gvanrossum
Recipients amaury.forgeotdarc, christian.heimes, gvanrossum
Date 2007-11-12.21:09:46
SpamBayes Score 0.00378051
Marked as misclassified No
Message-id <ca471dc20711121309n66bc8a7ck36714623188192d8@mail.gmail.com>
In-reply-to <4738BE2F.4000000@cheimes.de>
Content
> > I don't understand. When does the difference matter?
>
> When the check for fd < 0 is removed from fileio_init() there is no way
> to tell if fd < 0 means fd closed or invalid fd.

I still don't understand. Why do you need to treat a closed fd
different from an invalid fd. In both cases you can't use it and you
shouldn't close it.

> In order to fix the problem with GUI apps on Windows the check for fd <
> 0 has to be removed (Python 2.x way). Or we use Amaury's way and open
> NUL for reading and writing as a substitute for the standard streams.

I'd suggest that, on Windows, sys.std{in,out.err} should be set to
None instead of a file object when their file descriptor is invalid.
That way print and write requests will fail immediately instead of
nondeterministically. With an invalid file that only blows upwhen
trying to flush you may be able to write a small traceback but it will
still blow up if the traceback is big.

Is there a downside to print/write blowing up right away in apps using pythonw?
History
Date User Action Args
2007-11-12 21:09:46gvanrossumsetspambayes_score: 0.00378051 -> 0.00378051
recipients: + gvanrossum, amaury.forgeotdarc, christian.heimes
2007-11-12 21:09:46gvanrossumlinkissue1415 messages
2007-11-12 21:09:46gvanrossumcreate