-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nk.download_zip throws AttributeError
when invoked
#1061
Comments
I did some debugging and fixed the error by making the following changes to the def download_from_url(url, destination_path=None):
--- SNIP ---
# if response.status_code == 200:
if response.status == 200:
with destination_path.open("wb") as file:
# file.write(response.content)
file.write(response.read())
return True
else:
return False I have commented out the earlier code and replaced it with what I did to fix the issue. I believe the earlier error messages are due to changes to the HTTPResponse class in Python's HTTP library. I have checked that the changes show the expected behaviour of calling the aforementioned function. If you'd like to, I can create a PR for this. |
It looks like the issue occurred when removing the Good catch! Please do make a PR. |
[Fix] update data/database.py to use urllib methods. fixes #1061
Describe the bug
I ran the following code on Google Colab
this returns
To Reproduce
Run the above code on Google Colab or any Python environment
Expected behaviour
Download the files into the directory
Screenshots

System Specifications
OS: Linux (ELF 64bit)
Python: 3.11.11
NeuroKit2: 0.2.10
NumPy: 1.26.4
Pandas: 2.2.3
SciPy: 1.13.1
sklearn: 1.6.0
matplotlib: 3.10.0
The text was updated successfully, but these errors were encountered: