Message56607
| Author |
christian.heimes |
| Recipients |
brett.cannon, christian.heimes, gvanrossum |
| Date |
2007年10月20日.18:00:04 |
| SpamBayes Score |
0.009422514 |
| Marked as misclassified |
No |
| Message-id |
<471A4221.4070504@cheimes.de> |
| In-reply-to |
<ca471dc20710200836s6829a4c2l8c589fa69878cb6f@mail.gmail.com> |
| Content |
Guido van Rossum wrote:
> You're right that a lot of this could be avoided if we used file
> descriptors consistently. It seems find_module() itself doesn't read
> the file; it just needs to know that it's possible to open the file.
>
> Rewriting everywhere that uses PyFile_FromFile[Ex] to use file
> descriptors doesn't seem too hard; there are only a few places.
If I understand you right you want to alter the interface of
PyFile_FromFile and PyFile_FromFileEx from
PyFile_FromFileEx(FILE *fp, char *name, char *mode, int (*close)(FILE*),
int buffering, char *encoding, char *newline)
to
PyFile_FromFileEx(int fd, char *name, char *mode, int (*close)(FILE*),
int buffering, char *encoding, char *newline)
?
I could write a patch and remove int (*close)(FILE*), too. It's no
longer used by the functions.
Christian |
|