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:
parent
2658ff2862
commit
6571b50aae
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue