auth_manager=SpotifyOAuth(
causes indefinite hanging if provided with invalid client id or secret
#957
Labels
auth_manager=SpotifyOAuth(
causes indefinite hanging if provided with invalid client id or secret
#957
Describe the bug
When there's no valid
.cache
file for Spotipy to draw from, and an invalid client ID or secret is provided to the authorization code flow, when you next use thesp
object, the code opens a webpage that saysINVALID_CLIENT: Invalid client
and then hangs indefinitely. Atry/except
does nothing.If provided with an invalid callback URI (regardless of the validity of the client ID and secret), it will throw an error when you enter the URL you were sent to, so you're able to
try/except
as normal.Your code
Expected behavior
If provided with an invalid client ID and/or secret, it should throw an error, one that can be properly caught with a
try/except
.Seems the error would be better placed on the
sp = spotipy
line of code, but would work fine if it instead threw when it got used next, in this casesp.me()
. Doesn't really matter, as long as it gives an error that can be caught.Output
Running the above code results in this:
and then indefinite hanging. The behavior is exactly the same even if you use
try/except
around both statements, or if only one ID/secret is invalid.Environment:
2.12.02.22.1 (typo)Additional context
Not part of the bug report, but does anyone know an option besides A) bundle my app's client secret with the rest of my code and distribute it with cx_Freeze, which is no bueno lmao, or B) force my users to make their own app and provide their own IDs and secrets? I chose option B, which is why I'm making the above bug report rn, because I can't assume that my end user will provide valid IDs or secrets.
The text was updated successfully, but these errors were encountered: