From 7664d3509087132d0e2e3bd02e624ab18670ab79 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Tue, 1 Mar 2016 11:35:06 -0800 Subject: [PATCH] use abspath before looking for documents --- tldp/sources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tldp/sources.py b/tldp/sources.py index 2045cd7..41784ea 100644 --- a/tldp/sources.py +++ b/tldp/sources.py @@ -79,6 +79,7 @@ def scansourcedirs(dirnames): def arg_issourcedoc(filename): + filename = os.path.abspath(filename) if os.path.isfile(filename): return filename elif os.path.isdir(filename): @@ -101,7 +102,9 @@ def sourcedoc_fromdir(dirname): elif len(candidates) == 0: return None else: - return candidates.pop() + doc = candidates.pop() + logger.debug("%s identified main document %s.", stem, doc) + return doc class SourceCollection(LDPDocumentCollection):