biopragmatics / bioregistry

📮 An integrative registry of biological databases, ontologies, and nomenclatures.
https://bioregistry.io
MIT License
112 stars 49 forks source link

IsADirectoryError #43

Closed bgyori closed 3 years ago

bgyori commented 3 years ago

After starting from a clean /data/.data PYSTOW_HOME folder, I got this:

  File "/home/ubuntu/.virtualenvs/py38/lib/python3.8/site-packages/bioversions/sources/ols.py", line 76, in extend_ols_getters
    for ols_getter in iter_ols_getters(force_download=force_download):
  File "/home/ubuntu/.virtualenvs/py38/lib/python3.8/site-packages/bioversions/sources/ols.py", line 66, in iter_ols_getters
    ols = get_ols(force_download=force_download, mappify=True)
  File "/home/ubuntu/.virtualenvs/py38/lib/python3.8/site-packages/bioregistry/external/ols.py", line 27, in get_ols
    return ensure_registry(
  File "/home/ubuntu/.virtualenvs/py38/lib/python3.8/site-packages/bioregistry/external/utils.py", line 35, in ensure_registry
    with open(cache_path) as file:
IsADirectoryError: [Errno 21] Is a directory: '/data/.data/bioregistry/ols.json'

$ rm /data/.data/bioregistry/ols.
ols.json/ ols.tsv/  
$ rm -r /data/.data/bioregistry/ols.json/
$ rm -r /data/.data/bioregistry/ols.tsv/

I observed something similar for a folder with PyOBO, in that case

  File "/home/ubuntu/.virtualenvs/py38/lib/python3.8/site-packages/pyobo/utils/io.py", line 58, in open_map_tsv
    with open(path) as file:
IsADirectoryError: [Errno 21] Is a directory: '/data/.data/pyobo/raw/cl/cache/names.tsv'

so I wonder if this is actually a PyStow bug?

cthoyt commented 3 years ago

sorry I think I explained to you over a call what I think is going on, but didn't write it. I upgraded PyStow to make you explicitly say when something is a directory or a file, so this created some directories whose names look like files on code that wasn't upgraded.

bgyori commented 3 years ago

Thanks, I'll close this since it's been resolved elsewhere.