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 joshtriplett
Recipients joshtriplett
Date 2011-07-21.20:33:10
SpamBayes Score 1.2521708e-07
Marked as misclassified No
Message-id <1311280391.94.0.571188388286.issue12603@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.7.2, pydoc.py's synopsis contains this code implementing a cache:

    mtime = os.stat(filename).st_mtime
    lastupdate, result = cache.get(filename, (0, None))
    if lastupdate < mtime:

Many filesystems don't have any concept of mtime or don't have it available, including many FUSE filesystems, as well as our implementation of stat for GRUB in BITS.  Such systems typically return an mtime of 0.  (In addition, 0 represents a valid mtime.)  Since the cache in pydoc.synopsis initializes lastupdate to 0 for entries not found in the cache, this causes synopsis to always return None.  I'd suggest either extending the conditional to check "lastupdate != 0 and lastupdate < mtime" (which would always treat an mtime of 0 as requiring an update, which would make sense for filesystems without valid mtimes) or changing the .get to return (None, None) and checking "lastupdate is not None and lastupdate < mtime", which would treat an mtime of 0 as valid but still handle the case of not having a cache entry the first time.
History
Date User Action Args
2011-07-21 20:33:12joshtriplettsetrecipients: + joshtriplett
2011-07-21 20:33:11joshtriplettsetmessageid: <1311280391.94.0.571188388286.issue12603@psf.upfronthosting.co.za>
2011-07-21 20:33:11joshtriplettlinkissue12603 messages
2011-07-21 20:33:10joshtriplettcreate