Message215410
| Author |
paul.j3 |
| Recipients |
anacrolix, bethard, josh.r, moritz, paul.j3, pitrou |
| Date |
2014年04月03日.00:11:00 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1396483861.09.0.220278454963.issue14156@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
There are a couple of complications to using 'fileno'.
We probably don't want to close 'sys.stdin' or 'sys.stdout' (not even if they are redirected to other files?). That means using:
open(sys.stdin.fileno(), ..., closefd=False)
'closefd', on the other hand, has to be True for string file specifications.
But in 'test_argparse.py', 'sys.stdout' is redirected to an 'io.StringIO'. This has many of the same features as an open file, but 'fileno' is not implemented. So the TypeFile probably needs to make an exception for this case. I don't how this will play with a 'BytesIO' for 'wb' cases. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年04月03日 00:11:01 | paul.j3 | set | recipients:
+ paul.j3, pitrou, bethard, anacrolix, moritz, josh.r |
| 2014年04月03日 00:11:01 | paul.j3 | set | messageid: <1396483861.09.0.220278454963.issue14156@psf.upfronthosting.co.za> |
| 2014年04月03日 00:11:01 | paul.j3 | link | issue14156 messages |
| 2014年04月03日 00:11:00 | paul.j3 | create |
|