Skip to content

Commit

Permalink
pipelines: Add trailing slash to URI so that last component is not re…
Browse files Browse the repository at this point in the history
…moved during dereferencing
  • Loading branch information
jpmckinney committed Jun 24, 2020
1 parent be2da56 commit 74ac039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kingfisher_scrapy/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def __init__(self):
self.files = set()
self.file_items = set()
schema_path = pathlib.Path(os.path.dirname(os.path.abspath(__file__)), 'item_schema')
for item in ['File', 'FileError', 'FileItem']:
for item in ('File', 'FileError', 'FileItem'):
filename = os.path.join(schema_path, f'{item}.json')
with open(filename) as f:
schema = jsonref.load(f, base_uri=pathlib.Path(schema_path, 'item_schema').as_uri())
schema = jsonref.load(f, base_uri=schema_path.as_uri() + '/')
self.validators[item] = Draft4Validator(schema, format_checker=FormatChecker())

def process_item(self, item, spider):
Expand Down

0 comments on commit 74ac039

Please sign in to comment.