[GH-ISSUE #253] Entering an invalid URL in spotipy.util.prompt_for_user_token() obfuscates the error #138

Closed
opened 2026-02-27 23:21:01 +03:00 by kerem · 0 comments
Owner

Originally created by @pl4nty on GitHub (Feb 11, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/253

.oauth2.parse_response_code() returns None when an invalid authentication URL is given, which causes .oauth2.get_access_token to return a '400: Bad Gateway' error. This error could be related to any of the Request Access Token parameters, making it hard to track down.
Replacing the return None with something like raise InvalidUrlError("Invalid URL") would make the error easier to trace.

Originally created by @pl4nty on GitHub (Feb 11, 2018). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/253 .oauth2.parse_response_code() returns None when an invalid authentication URL is given, which causes .oauth2.get_access_token to return a '400: Bad Gateway' error. This error could be related to any of the Request Access Token parameters, making it hard to track down. Replacing the `return None` with something like `raise InvalidUrlError("Invalid URL")` would make the error easier to trace.
kerem 2026-02-27 23:21:01 +03:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#138
No description provided.