Make os.stat return full precision on macOS too

Closed Julian Berman requested to merge branch/more-precise-stat-time-on-macos into branch/py3.6

This branch should make this code:

touch foo; for each in pypy3 python3.6; do echo $each; "$each" -c 'import os; print(os.stat("foo").st_mtime)'; done

return the same values on PyPy3 as they do on CPython, whereas previously on macOS, the current output looks like:

pypy3
1595102832.0
python3.6
1595102832.18213

and some precision is lost.

macOS has timespec structs, at least on Catalina. I'm hoping the Buildbot should tell me whether that's the case on whatever presumably-older version of macOS it runs?

Comments obviously welcome.

Edited by Julian Berman

Merge request reports