tests: work around strange mtime granularity issue on netbsd, fixes #204

not sure where the problem is:
it seems to announce it supports st_mtime_ns, but if one uses it and
has a file with ...123ns, i t gets restored as ...000ns.

Then I tried setting st_mtime_ns_round to -3, but it still failed with +1000ns difference.

Maybe rounding is incorrect and it should be truncating?
Issue with granularity could be in python, in netbsd (netbsd platform code), in ffs filesystem, ...
This commit is contained in:
Thomas Waldmann 2015-09-18 00:02:44 +02:00
parent 48634d4e96
commit 375717c095
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ elif 'HAVE_UTIMES' in sysconfig.get_config_vars():
else:
st_mtime_ns_round = -9
if sys.platform.startswith('netbsd'):
st_mtime_ns_round = -4 # only >1 microsecond resolution here?
has_mtime_ns = sys.version >= '3.3'
utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})