You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not clear (to me) when this bug was introduced, it is possible that it's existed for the entire lifetime of tklbam.
The stat structure's mtime value is now almost always a float. Pre python 2.5 it was an int by default, 2.5 and after it is a float for all systems that support sub-second mtime values. Nowadays, most systems support sub-second mtime values afaik.
The latter is the real issue, this is the value that will be written to a file by dirindex. In python2, the %x format specifier will accept a float and silently truncate it, then format it as an integer in hex.
Because of this changes.whatschanged will report files as being different, even between a dirindex, and the same dirindex that has been saved to file.
The text was updated successfully, but these errors were encountered:
Good find! As discussed offline, initially we'll convert tklbam to modern python - including any existing bugs such as this one. Then we can look at resolving them.
It's not clear (to me) when this bug was introduced, it is possible that it's existed for the entire lifetime of tklbam.
The
stat
structure's mtime value is now almost always a float. Pre python 2.5 it was an int by default, 2.5 and after it is a float for all systems that support sub-second mtime values. Nowadays, most systems support sub-second mtime values afaik.The mtime value is handled incorrectly in 2 places:
https://github.com/turnkeylinux/tklbam/blob/ec65887692fe336f121d95fdeb97c8dd31bd01e7/dirindex.py#L71
and
https://github.com/turnkeylinux/tklbam/blob/ec65887692fe336f121d95fdeb97c8dd31bd01e7/dirindex.py#L63
The latter is the real issue, this is the value that will be written to a file by dirindex. In python2, the
%x
format specifier will accept a float and silently truncate it, then format it as an integer in hex.Because of this
changes.whatschanged
will report files as being different, even between a dirindex, and the same dirindex that has been saved to file.The text was updated successfully, but these errors were encountered: