mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #828] Breaking change in minor version? #510
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#510
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SHxKM on GitHub (Jun 11, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/828
Hi,
Super glad to see this maintained after a long halt.
I've noticed after upgrading from
2.4.4.to2.19.0that some endpoints likesearchno longer work when theSpotipyobject is initialized with aauthparam.My old code (now returns an error):
The new code:
Meanwhile, user-related endpoints continue to work with
token.Is this expected? I couldn't find anything in the release notes regarding this. Maybe I didn't look hard enough.
Also: am I correct in saying that the cache system is only for the application's access token, not those of the application's users?
@Peter-Schorn commented on GitHub (Jun 13, 2022):
This will always return an error after an hour when the access token expires. The refresh token has not been saved. Therefore, this pattern is never recommended.
Follow the pattern shown on the README:
@SHxKM commented on GitHub (Jun 13, 2022):
@Peter-Schorn that code is just a simplified example. I’m not complaining that it’s changed I just want to know if it indeed was. Because it did work with 2.4.4.
@Peter-Schorn commented on GitHub (Jun 13, 2022):
Your code is flawed for any version as already described.
@SHxKM commented on GitHub (Jun 13, 2022):
You can repeat yourself being condescending all you want. The question remains: a code that works (even for a split second) in 2.4.4 doesn’t work at all in 2.19.0, is this breaking change intended? If you are uninterested in answering that, don’t.
I didn’t ask for a code review. I asked if something broke between versions.
@Peter-Schorn commented on GitHub (Jun 13, 2022):
Don't know.
@stephanebruckert commented on GitHub (Jun 13, 2022):
It should probably still work and looks like a bug. It's really weird that it works for a user endpoint but not for a non-user endpoint.
Can you please share the error with stack trace and any warning spotipy might be raising?
@SHxKM commented on GitHub (Jun 15, 2022):
Hi @stephanebruckert, thank you. With
2.19.0here's the exception of typespotipy.client.SpotifyException:As I said, with
2.4.4this works fine.@stephanebruckert commented on GitHub (Jun 15, 2022):
@SHxKM in your "old" code can you try to replace
with
and let me know if it helps?
@SHxKM commented on GitHub (Jun 15, 2022):
Yes,
as_dict=Falsesolves the issue. Can you elaborate on this please?@stephanebruckert commented on GitHub (Jun 15, 2022):
Since 2.4.4, was added a new parameter
as_dict.github.com/plamere/spotipy@06551cd055/spotipy/oauth2.py (L213)Looks like it should be False by default instead of True for things to remain backward-compatible
@SHxKM commented on GitHub (Jun 15, 2022):
Thank you for taking the time to look into this. I guess for now if I don't find additional issues I'll just do:
By the way, is the
spotipy.Spotifyobject designed to a be a singleton? Because in some parts of my code I repetitively initialize it en-masse, and I'm wondering if that's what's leading to high memory usage.@stephanebruckert commented on GitHub (Jun 15, 2022):
It looks like it is, I would try to initialise it once and pass it where you need. Particularly since the tokens auto-refresh in newer versions!
@SHxKM commented on GitHub (Jun 15, 2022):
Got it. I wonder if that'll mess things up when I'm authenticating both on the app-level and the-user level. But that's for another issue. Thanks a lot @stephanebruckert!
@SHxKM commented on GitHub (Jun 16, 2022):
@stephanebruckert one thing we didn't discuss is why it didn't affect user-level endpoints? (those that require user authorization) Do you know the answer?
@Peter-Schorn commented on GitHub (Jun 16, 2022):
Spotifyis not a singleton, but you should generally only be using one instance of it in your program, especially if you've only authenticated with one user. Do not authenticate separately for different endpoints. That's a waste of your time.