Charles-François Natali <neolo...@free.fr> added the comment: Demo:
""" cf@neobox:~/cpython$ ./python -c "import pydoc; print(pydoc.synopsis('Lib/os.py'))" OS routines for Mac, NT, or Posix depending on what system we're on. [51835 refs] cf@neobox:~/cpython$ touch -t 197001010000 Lib/os.py cf@neobox:~/cpython$ ./python -c "import pydoc; print(pydoc.synopsis('Lib/os.py'))" None [51833 refs] """ > 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". You mean "lastupdate is None or lastupdate < mtime"? Otherwise, a file not present in the cache would never be looked-up. Here's a patch. It's obvious, but note that if the filesystem doesn't provide mtime, then once the metadata has been cached, it won't be refreshed if the file is updated. I'll take a look around the standard library for similar issues. Note: it would of course be simpler to use -1 as the default mtime value, but a negative time_t is possible. ---------- keywords: +needs review, patch stage: needs patch -> patch review Added file: http://bugs.python.org/file22730/pydoc_mtime.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12603> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com