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 gvanrossum
Recipients brett.cannon, christian.heimes, gvanrossum
Date 2007-10-20.22:36:15
SpamBayes Score 0.0017667125
Marked as misclassified No
Message-id <ca471dc20710201536x53a22f1di337c0b04732e8e04@mail.gmail.com>
In-reply-to <471A6241.5090907@cheimes.de>
Content
> Is PyFile_FromFd and PyFile_FromFdEx fine with you or do you prefer a
> different name like PyFile_FromFD and PyFile_FromFDEx or
> PyFile_FromFileDescriptor?

Let's have a single function PyFile_FromFd(fd, name, mode, buffering,
encoding, newline).

> I've another question. The os.tmpfile method is using tmpfile() which
> returns a file pointer. Do I have to dup its file number and explictely
> close the file pointer as shown below or is a simple fileno() enough?

You should dup it; if you don't dup it, the fd will be closed when you
call fclose(), rendering it useless; or when you don't call fclose(),
you leak a FILE struct each time.
History
Date User Action Args
2007-10-20 22:36:16gvanrossumsetspambayes_score: 0.00176671 -> 0.0017667125
recipients: + gvanrossum, brett.cannon, christian.heimes
2007-10-20 22:36:16gvanrossumlinkissue1267 messages
2007-10-20 22:36:15gvanrossumcreate