Am 01.07.14 09:44, schrieb Victor Stinner: > scandir(fd) must not close the file descriptor, it should be done by > the caller. Handling the lifetime of the file descriptor is a > difficult problem, it's better to let the user decide how to handle > it.
This is an open issue still: when is the file descriptor closed. I think the generator returned from scandir needs to support a .close method that guarantees to close the file descriptor. AFAICT, the pure-Python prototype of scandir already does, but it should be specified in the PEP. While we are at it: is it intended that the generator will also support the other generator methods, in particular .send and .throw? Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com