[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

Josh Triplett report at bugs.python.org
Sat Jul 23 03:09:50 CEST 2011


Josh Triplett <josh at joshtriplett.org> added the comment:

The current behavior of pydoc will cause synopsis to always incorrectly return "None" as the synopsis for any module with mtime == 0.  Both of the proposed fixes will fix that bug without affecting any case where mtime != 0, so I don't think either one has backward-compatibility issues.

I'd suggest using the fix of changing the .get call to return a default of (None, None) and changing the conditional to "lastupdate is not None and lastupdate < mtime".  That variant seems like more obvious code (since None clearly means "no lastupdate time"), and it avoids special-casing an mtime of 0 and bypassing the synopsis cache.

I don't mind writing a patch if that would help this fix get in.  I'll try to write onein the near future, but I certainly won't mind if someone else beats me to it. :)

----------

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


More information about the Python-bugs-list mailing list