From 72a6cd9190b9cd3919479b4ebeb30483a6943969 Mon Sep 17 00:00:00 2001 From: Mohammad Momeni Date: Sun, 19 Jun 2022 02:47:58 +0430 Subject: [PATCH] Fix text attribute for Response object (#811) * Fix text attribute for Response object * Add a changelog for the AttributeError PR --- CHANGELOG.md | 1 + spotipy/oauth2.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 074c40e..d51300e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Changed URI handling in `client.Spotify._get_id()` to remove qureies if provided by error. * Added a new parameter to `RedisCacheHandler` to allow custom keys (instead of the default `token_info` key) * Simplify check for existing token in `RedisCacheHandler` +* Fix `AttributeError` for `text` attribute of the `Response` object ### Changed * Removed Python 3.5 and added Python 3.9 in Github Action diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index a7ce334..0f30f5f 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -140,7 +140,7 @@ class SpotifyAuthBase(object): # then try do decode it into text # if we receive an empty string (which is falsy), then replace it with `None` - error = response.txt or None + error = response.text or None error_description = None raise SpotifyOauthError(