summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-13 02:19:40 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-13 02:19:40 (GMT)
commit58cb1b8b0ef200b7f7d4aba82642a63ce7532545 (patch)
tree629216d60c66aaf168ee0f4903824213fcf4637f /Doc/library
parentf05149a257560144cbaaea3e96c404803dbf26e4 (diff)
downloadcpython-58cb1b8b0ef200b7f7d4aba82642a63ce7532545.zip
cpython-58cb1b8b0ef200b7f7d4aba82642a63ce7532545.tar.gz
cpython-58cb1b8b0ef200b7f7d4aba82642a63ce7532545.tar.bz2
Fix for #1415 pythonw.exe fails because std streams a missing
After a long discussion about the problem with Windows GUI apps Guido decided that sys.stdin, stdout and stderr should be None when the C runtime library returns invalid file descriptors for the standard streams. So far the only known cases are Windows GUI apps and scripts started with pythonw on Windows. The OS restrictions are tight enough to catch the problem on other OSes.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/sys.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 6f1aaff..94e4eb9 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -513,6 +513,13 @@ always available.
could be useful to restore the actual files to known working file objects in
case they have been overwritten with a broken object.
+ .. note::
+
+ Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the
+ original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be
+ None. It is usually the case for Windows GUI apps that aren't connected to
+ a console and Python apps started with :program:`pythonw`.
+
.. data:: tracebacklimit
@@ -571,3 +578,4 @@ always available.
Module :mod:`site`
This describes how to use .pth files to extend ``sys.path``.
+