Skip to content
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

This can be None #427

Open
drozzy opened this issue Mar 25, 2024 · 3 comments
Open

This can be None #427

drozzy opened this issue Mar 25, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@drozzy
Copy link

drozzy commented Mar 25, 2024

data can be none (as set by the code within exception clause above).
This failed on me already.

error_message = data.get("error") or data or "(no information available)"

@danielfernau danielfernau self-assigned this Mar 26, 2024
@danielfernau danielfernau added the question Further information is requested label Mar 26, 2024
@danielfernau
Copy link
Owner

Hi and thanks for reporting. You have created a PR but deleted it afterwards - is this issue still relevant and you just wanted to try something that didn't work? Let me know if you need me to have another look at it.

@drozzy
Copy link
Author

drozzy commented Mar 26, 2024

I deleted that by mistake. But PR was just a single line change in download_file.py.
This:

try:
    data = json.loads(response.content)
except Exception:
    data = None

Becomes this:

try:
    data = json.loads(response.content)
except Exception:
    data = {}

@danielfernau
Copy link
Owner

Alright, yes, that makes sense. Will add it later and bundle an update. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants