Message195836
is_valid_fd() of Python/pythorun.c should use fstat() to check if a file descriptor is valid, instead of duplicating it using dup() (and then closing it).
If Windows needs a special check, it would be better to run checks on the handle of the file descriptor.
The function was added by the following changeset:
----------------------------
branch: 3.2
parent: 73773:661fb211f220
user: Antoine Pitrou <solipsis@pitrou.net>
date: Mon Nov 28 19:08:36 2011 +0100
files: Lib/test/test_cmd_line.py Misc/NEWS Python/pythonrun.c
description:
Issue #7111: Python can now be run without a stdin, stdout or stderr stream.
It was already the case with Python 2. However, the corresponding
sys module entries are now set to None (instead of an unusable file object).
----------------------------
See also issue #17797 "Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program". |
|
Date |
User |
Action |
Args |
2013-08-21 23:07:47 | vstinner | set | recipients:
+ vstinner, pitrou |
2013-08-21 23:07:47 | vstinner | set | messageid: <1377126467.82.0.012503473328.issue18804@psf.upfronthosting.co.za> |
2013-08-21 23:07:47 | vstinner | link | issue18804 messages |
2013-08-21 23:07:47 | vstinner | create | |
|