Only try to open a legacy url if it leads to a file; not if it leads to a directory.

- Legacy-Id: 2770
This commit is contained in:
Henrik Levkowetz 2011-01-28 09:52:14 +00:00
parent 2658ff2862
commit 6571b50aae

View file

@ -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()