Message56957
Guido van Rossum wrote:
> Shouldn't closefd be passed as 1 in import.c?
>
> I don't see the point of distinguishing between -1 and +1. The block
> "if (closefd < 0) { closefd = 1; }" looks rather silly.
I used -1 as default to keep it consistent with buffer=-1. I figured out
that I can go with "closefd != 0 means close it".
> In io.py, you should document that closefd must not be False when a
> filename is given.
Done
> I think in _fileio.c, you can insist that the closefd argument is an int
> (a bool will work anyway, as bool is a subclass of int).
Thanks, it makes the code a bit easier.
> I don't think we should warn when trying to close an unclosable fd; it
> should really just be a no-op. Also, if you are going to call
> PyErr_WarnEx(), you should test its return value (it can raise an
> exception!).
I think we should keep the warning. The warning made me aware of a minor
bug in quopri.
> Please don't add trailing whitespace.
I've reconfigured my editor to remove trailing spaces.
I've attached a combined patch for closefd and preliminary stderr.
Christian |
|
Date |
User |
Action |
Args |
2007-10-30 06:33:20 | christian.heimes | set | spambayes_score: 0.00281736 -> 0.0028173595 recipients:
+ christian.heimes, gvanrossum, nnorwitz, MrJean1 |
2007-10-30 06:33:20 | christian.heimes | link | issue1329 messages |
2007-10-30 06:33:18 | christian.heimes | create | |
|