I was pruning down a CLDF dataset to make a test dataset, and removed sources.bib as it was large (and unnecessary for the tests). I also changed the source specificiation in cldf-metadata.json to "dc:source": "", (i.e. what I thought was saying there are no sources.bib).
... this generates the following:
IsADirectoryError: [Errno 21] Is a directory: '/Users/simon/projects/lexistats/lexiflow2/tests/glottolog-cldf/cldf'
... the error is not that sources.bib is a directory but that pycldf looks for cldf-directory / filename which as I set it to "" is then just the directory. Perhaps a better check would be that filename is non-empty and not filename.isdir() ?
Traceback (via pytest):
lexiflow/lexiflow.py:52: in glottolog
g = StructureDataset.from_metadata(md)
../../../.pyenv/versions/3.7.0/lib/python3.7/site-packages/pycldf/dataset.py:507: in from_metadata
return mod.cls(tablegroup)
../../../.pyenv/versions/3.7.0/lib/python3.7/site-packages/pycldf/dataset.py:133: in __init__
self.sources = Sources.from_file(self.bibpath)
../../../.pyenv/versions/3.7.0/lib/python3.7/site-packages/pycldf/sources.py:101: in from_file
res.read(fname)
../../../.pyenv/versions/3.7.0/lib/python3.7/site-packages/pycldf/sources.py:177: in read
pathlib.Path(fname).read_text(encoding='utf-8'),
../../../.pyenv/versions/3.7.0/lib/python3.7/pathlib.py:1178: in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
I was pruning down a CLDF dataset to make a test dataset, and removed sources.bib as it was large (and unnecessary for the tests). I also changed the source specificiation in cldf-metadata.json to
"dc:source": "",
(i.e. what I thought was saying there are no sources.bib).... this generates the following:
... the error is not that sources.bib is a directory but that pycldf looks for
cldf-directory / filename
which as I set it to "" is then just the directory. Perhaps a better check would be that filename is non-empty andnot filename.isdir()
?Traceback (via pytest):