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

Raise for status when Yahoo! returns 403 / use User-Agent header #74

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Rudd-O
Copy link
Contributor

@Rudd-O Rudd-O commented Feb 22, 2023

Sometimes Yahoo! returns 403. This causes a tuple destructuring error later in parse_response(), when .json() actually does not return anything that can be destructured. The correct defensive behavior is to fail fast and exit here.

For some symbols, there is no data in the return dictionary. This causes a destructuring IndexError. We now correctly handle this.

Finally, there is a problem when using the default requests user agent (Y! always returns 403 in that case). So we use our own agent to make it work.

Sometimes Yahoo! returns 403.  This causes a tuple destructuring error later in `parse_response()`, when `.json()` actually does not return anything that can be destructured.

The correct defensive behavior is to fail fast and exit here.
@Rudd-O Rudd-O changed the title Raise for status when Yahoo! returns 403 Raise for status when Yahoo! returns 403 / use User-Agent header Feb 22, 2023
@Rudd-O
Copy link
Contributor Author

Rudd-O commented Feb 22, 2023

OK! QA passed.

@Rudd-O
Copy link
Contributor Author

Rudd-O commented Feb 22, 2023

Please make a stable release with these fixes. Otherwise Beancount users will not be able to use Yahoo!

@blais
Copy link
Member

blais commented Jun 16, 2024

This is in conflict with current version.
If you can resolve conflicts and fix the tests I'd merge this right away.

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

Successfully merging this pull request may close these issues.

2 participants