From 6571b50aae833ec51c86a6300c8bdb4b470de66d Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 28 Jan 2011 09:52:14 +0000 Subject: [PATCH] Only try to open a legacy url if it leads to a file; not if it leads to a directory. - Legacy-Id: 2770 --- ietf/ipr/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/ipr/search.py b/ietf/ipr/search.py index e5e4a9fe9..5af8e9dd4 100644 --- a/ietf/ipr/search.py +++ b/ietf/ipr/search.py @@ -41,7 +41,7 @@ def patent_file_search(url, q): fname = url.split("/")[-1] fpath = os.path.join(settings.IPR_DOCUMENT_PATH, fname) #print "*** Checking file", fpath - if os.path.exists(fpath): + if os.path.isfile(fpath): #print "*** Found file", fpath file = codecs.open(fpath, mode='r', encoding='utf-8', errors='replace') text = file.read()