Message81321
I think the comment (an invalid fd would be a C program bug)
misrepresents the facts. Please don't check it in as-is. An invalid file
descriptor is *not* assertable. The authority on file descriptors, the
POSIX standard, specifies for, say, write(2)
[...] Otherwise, -1 shall be returned and errno set to indicate the error.
[...] [EBADF] The fildes argument is not a valid file descriptor open
for writing.
This is consistent throughout the entire API: the behavior for invalid
file descriptors is *not* undefined, and not even
implementation-defined. If the CRT would conform to the relevant,
long-existing specifications it tries to emulate, it would just set
errno to EBADF, and be done.
There should be a global declaration of _Py_verify_fd. I would also
suggest that it becomes a constant macro unless _MSC_VER is defined. |
|
Date |
User |
Action |
Args |
2009-02-06 23:57:53 | loewis | set | recipients:
+ loewis, mhammond, amaury.forgeotdarc, kristjan.jonsson, ocean-city |
2009-02-06 23:57:53 | loewis | set | messageid: <1233964673.18.0.997263827668.issue4804@psf.upfronthosting.co.za> |
2009-02-06 23:56:53 | loewis | link | issue4804 messages |
2009-02-06 23:56:51 | loewis | create | |
|