A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-October/092814.html below:

[Python-Dev] PEP 389: argparse - new command line parsing module

[Python-Dev] PEP 389: argparse - new command line parsing module [Python-Dev] PEP 389: argparse - new command line parsing moduleAmaury Forgeot d'Arc amauryfa at gmail.com
Thu Oct 8 19:19:59 CEST 2009
2009/10/8 Paul Moore <p.f.moore at gmail.com>:
> 2009/10/7 Antoine Pitrou <solipsis at pitrou.net>:
>> Python 3 complains at startup and is a bit more explicit:
>>
>> $ ./python -c '1' >&-
>> Fatal Python error: Py_Initialize: can't initialize sys standard streams
>> OSError: [Errno 9] Bad file descriptor
>> Abandon
>>
>> Of course, if it is stderr that you explicitly close, you lose all reporting:
>>
>> $ ./python -c '1' 2>&-
>> Abandon
>
> Hmm, how does Python 3's pythonw work on Windows? (I don't have a
> Windows installation of Python 3 to hand at the moment)

When running pythonw, fileno(stdout) is negative, so sys.stdout is set to None,
and print() silently returns.
But the situation is not perfect, see http://bugs.python.org/issue6501
where Apache provides a stdout, but python cannot determine the
encoding because there is no console.

-- 
Amaury Forgeot d'Arc
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4