[issue17428] replace readdir to readdir_r in function posix_listdir

R. David Murray report at bugs.python.org
Sat Mar 16 03:30:54 CET 2013


R. David Murray added the comment:

My man page says "The  data  returned by readdir() may be overwritten by subsequent calls to readdir() for the same directory stream."  Ross I believe was quoting from the posix *spec*, so that is a more complete explanation.  If an implementation is doing what you said, it would be out of compliance with posix.

Python opens a new directory stream inside listdir, and that directory stream is not exposed to the Python code, so there is no way for another Python thread to cause a problem here.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17428>
_______________________________________


More information about the Python-bugs-list mailing list