This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients MrJean1, christian.heimes, gvanrossum, nnorwitz
Date 2007-10-30.06:33:18
SpamBayes Score 0.0028173595
Marked as misclassified No
Message-id <4726D028.3080506@cheimes.de>
In-reply-to <1193704946.42.0.939603638817.issue1329@psf.upfronthosting.co.za>
Content
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
Files
File name Uploaded
py3k_combined_preliminary_closefd.patch christian.heimes, 2007-10-30.06:33:18
History
Date User Action Args
2007-10-30 06:33:20christian.heimessetspambayes_score: 0.00281736 -> 0.0028173595
recipients: + christian.heimes, gvanrossum, nnorwitz, MrJean1
2007-10-30 06:33:20christian.heimeslinkissue1329 messages
2007-10-30 06:33:18christian.heimescreate