[issue13645] import machinery vulnerable to timestamp collisions

Antoine Pitrou report at bugs.python.org
Sun Jan 1 16:09:32 CET 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> You could add the requisite path_size() method to get the value, and
> assume 0 means unsupported

I thought:
- calling two methods means two stat calls per file, this could be slightly inefficient
- if future extensions of the import mechanism require yet more stat information (for example owner or chmod), it will be yet another bunch of stat'ing methods to create

(besides, calling int() on the timestamp is a loss of information, I don't understand why this must be done in path_mtime() rather than let the consumer do whatever it wants with the higher-precision timestamp)

----------

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


More information about the Python-bugs-list mailing list