JGCRI/tethys

JOSS Review: Unable to Download Supplement Data per Instructions

Closed this issue · 0 comments

Hi there,

I found another issue as part of my JOSS review (openjournals/joss-reviews#5855) related to getting the example data (Python 3.10, Windows 11 - I can print out my environment contents if you'd like, but I don't think it's related):

(base) (tethys) PS C:\Users\nickrsan\CodeLocal> python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tethys
>>> tethys.get_example_data()
Downloading example data for Tethys version 2.0.0. This might take a few minutes.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "environments\tethys\lib\site-packages\tethys-2.0.0-py3.10.egg\tethys\utils\install_supplement.py", line 72, in get_example_data
    zen.fetch_zenodo()
  File "environments\tethys\lib\site-packages\tethys-2.0.0-py3.10.egg\tethys\utils\install_supplement.py", line 47, in fetch_zenodo
    with zipfile.ZipFile(BytesIO(r.content)) as zipped:
  File "\Python\Python310\lib\zipfile.py", line 1267, in __init__
    self._RealGetContents()
  File "Python\Python310\lib\zipfile.py", line 1334, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

It takes quite a bit, even on a good connection before the error shows up, and I see the RAM consumption and network activity indicating the download is proceeding. I spent a bit of time debugging it, but the size of the response object in this case prevents debugger introspection on my machine -I suspect that simply writing the file to disk first would work around that, and maybe the root cause.

Happy to provide any additional useful information. Thanks!