Josh Rosenberg <> added the comment:

fstat is async signal safe, and I suspect it's thread safe in general, though 
usage does rely on the file descriptor remaining valid. If the fd in question 
is closed in another thread after the GIL is released, fstat would fail; if a 
new file is opened and assigned the same fd, it would give erroneous results. 
But I don't think any of that would lead to fundamentally incorrect behavior 
(after all, you could do the same thing manually by caching an fd then closing 
the file).

nosy: +josh.r

Python tracker <>
Python-bugs-list mailing list

Reply via email to