From: Charles-François Natali Date: Wed, 27 Jul 2011 17:36:40 +0000 (+0200) Subject: - Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0cf7e25c28d48cd41819bc60ced0c9daa785c67a;p=python - Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index f11940438c..6bf6eb371b 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -212,8 +212,8 @@ def source_synopsis(file): def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename).st_mtime - lastupdate, result = cache.get(filename, (0, None)) - if lastupdate < mtime: + lastupdate, result = cache.get(filename, (None, None)) + if lastupdate is None or lastupdate < mtime: info = inspect.getmoduleinfo(filename) try: file = open(filename) diff --git a/Misc/NEWS b/Misc/NEWS index c587f6ec6d..9a99595d58 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -37,6 +37,8 @@ Core and Builtins Library ------- +- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. + - Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is given as a low fd, it gets overwritten.