Message140997
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. |
|
Date |
User |
Action |
Args |
2011-07-23 17:21:37 | neologix | set | recipients:
+ neologix, ncoghlan, vstinner, joshtriplett, ron_adam, eric.araujo |
2011-07-23 17:21:37 | neologix | set | messageid: <1311441697.21.0.800776453563.issue12603@psf.upfronthosting.co.za> |
2011-07-23 17:21:36 | neologix | link | issue12603 messages |
2011-07-23 17:21:36 | neologix | create | |
|