This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients eric.araujo, joshtriplett, ncoghlan, neologix, ron_adam, vstinner
Date 2011-07-23.17:21:36
SpamBayes Score 2.791949e-06
Marked as misclassified No
Message-id <1311441697.21.0.800776453563.issue12603@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-07-23 17:21:37neologixsetrecipients: + neologix, ncoghlan, vstinner, joshtriplett, ron_adam, eric.araujo
2011-07-23 17:21:37neologixsetmessageid: <1311441697.21.0.800776453563.issue12603@psf.upfronthosting.co.za>
2011-07-23 17:21:36neologixlinkissue12603 messages
2011-07-23 17:21:36neologixcreate