# Buggy code
def _internal_call(self, method, url, payload, params):
    args = dict(params=params)
    if not url.startswith("http"):
        url = self.prefix + url
    headers = self._auth_headers()

    if "content_type" in args["params"]:
        headers["Content-Type"] = args["params"]["content_type"]
        del args["params"]["content_type"]
        if payload:
            args["data"] = payload
    else:
        headers["Content-Type"] = "application/json"
        if payload:
            args["data"] = json.dumps(payload)

    if self.language is not None:
        headers["Accept-Language"] = self.language

    logger.debug(
        "Sending %s to %s with Headers: %s and Body: %r ",
        method,
        url,
        headers,
        args.get("data"),
    )

    try:
        response = self._session.request(
            method,
            url,
            headers=headers,
            proxies=self.proxies,
            timeout=self.requests_timeout,
            **args,
        )

        response.raise_for_status()
        results = response.json()
    except requests.exceptions.HTTPError as http_error:
        response = http_error.response
        try:
            msg = response.json()["error"]["message"]
        except (ValueError, KeyError):
            msg = "error"
        try:
            reason = response.json()["error"]["reason"]
        except (ValueError, KeyError):
            reason = None

        logger.error(
            "HTTP Error for %s to %s returned %s due to %s",
            method,
            url,
            response.status_code,
            msg,
        )

        raise SpotifyException(
            response.status_code,
            -1,
            "%s:\n %s" % (response.url, msg),
            reason=reason,
            headers=response.headers,
        )
    except requests.exceptions.RetryError as retry_error:
        response = retry_error.response
        logger.error("Max Retries reached")
        raise SpotifyException(
            599,
            -1,
            "%s:\n %s" % (response.url, "Max Retries"),
            headers=response.headers,
        )
    except ValueError:
        results = None

    logger.debug("RESULTS: %s", results)
    return results


# Traceback (urllib3.exceptions.MaxRetryError)
Max Retries reached
Traceback (most recent call last):
File "../project/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "../project/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 817, in urlopen
return self.urlopen(
File "../project/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 817, in urlopen
return self.urlopen(
File "../project/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 817, in urlopen
return self.urlopen(
File "../project/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 807, in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
File "../project/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/playlists/37i9dQZF1DWXLeA8Omikj7/followers/contains?ids=spotify:user:bad_fakename (Caused by ResponseError('too many 500 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "../project/venv/lib/python3.8/site-packages/spotipy/client.py", line 239, in _internal_call
response = self._session.request(
File "../project/venv/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "../project/venv/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "../project/venv/lib/python3.8/site-packages/requests/adapters.py", line 507, in send
raise RetryError(e, request=request)
requests.exceptions.RetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/playlists/37i9dQZF1DWXLeA8Omikj7/followers/contains?ids=spotify:user:bad_fakename (Caused by ResponseError('too many 500 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "../project/src/issue_boilerplate.py", line 10, in <module>
print(spotify.playlist_is_following(playlist_id=playlist['id'], user_ids=['spotify:user:bad_fakename']))
File "../project/venv/lib/python3.8/site-packages/spotipy/client.py", line 1145, in playlist_is_following
return self._get(
File "../project/venv/lib/python3.8/site-packages/spotipy/client.py", line 286, in _get
return self._internal_call("GET", url, payload, kwargs)
File "../project/venv/lib/python3.8/site-packages/spotipy/client.py", line 273, in _internal_call
"%s:\n %s" % (response.url, "Max Retries"),
AttributeError: 'NoneType' object has no attribute 'url'

# Fixed code
def _internal_call(self, method, url, payload, params):
    args = dict(params=params)
    if not url.startswith("http"):
        url = self.prefix + url
    headers = self._auth_headers()

    if "content_type" in args["params"]:
        headers["Content-Type"] = args["params"]["content_type"]
        del args["params"]["content_type"]
        if payload:
            args["data"] = payload
    else:
        headers["Content-Type"] = "application/json"
        if payload:
            args["data"] = json.dumps(payload)

    if self.language is not None:
        headers["Accept-Language"] = self.language

    logger.debug(
        "Sending %s to %s with Headers: %s and Body: %r ",
        method,
        url,
        headers,
        args.get("data"),
    )

    try:
        response = self._session.request(
            method,
            url,
            headers=headers,
            proxies=self.proxies,
            timeout=self.requests_timeout,
            **args,
        )

        response.raise_for_status()
        results = response.json()
    except requests.exceptions.HTTPError:
        try:
            msg = response.json()["error"]["message"]
        except (ValueError, KeyError):
            msg = "error"
        try:
            reason = response.json()["error"]["reason"]
        except (ValueError, KeyError):
            reason = None

        logger.error(
            "HTTP Error for %s to %s returned %s due to %s",
            method,
            url,
            response.status_code,
            msg,
        )

        raise SpotifyException(
            response.status_code,
            -1,
            "%s:\n %s" % (response.url, msg),
            reason=reason,
            headers=response.headers,
        )
    except requests.exceptions.RetryError:
        logger.error("Max Retries reached")
        raise SpotifyException(
            599,
            -1,
            "%s:\n %s" % (response.url, "Max Retries"),
            headers=response.headers,
        )
    except ValueError:
        results = None

    logger.debug("RESULTS: %s", results)
    return results