spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
5.05k stars 960 forks source link

TypeError after Django Migration #621

Open RobinReborn opened 4 years ago

RobinReborn commented 4 years ago

Describe the bug Exception raised after Django migration, ie python manage.py migrate within a pipenv Your code I can share my django models and migrations and Pipfile if necessary Expected behavior A clear and concise description of what you expected to happen.

Output Exception ignored in: <function Spotify.__del__ at 0x7fb96d7d4680> Traceback (most recent call last): File "/home/robin/.virtualenvs/moodstream-django-EtsEGWRm/lib/python3.7/site-packages/spotipy/client.py", line 188, in __del__ TypeError: isinstance() arg 2 must be a type or tuple of types Exception ignored in: <function SpotifyAuthBase.__del__ at 0x7fb96d8088c0> Traceback (most recent call last): File "/home/robin/.virtualenvs/moodstream-django-EtsEGWRm/lib/python3.7/site-packages/spotipy/oauth2.py", line 136, in __del__ TypeError: isinstance() arg 2 must be a type or tuple of types Environment:

Additional context Add any other context about the problem here.

stephanebruckert commented 3 years ago

I cannot think of anything obvious, it would be useful to get a bit more context:

menef0124 commented 3 years ago

I also get the same exact exceptions raised just from having the line import flask in one of my scripts. I haven't actually written anything using Flask yet and the script works fine but the exceptions still occur.

succinct commented 2 years ago

I'm seeing this same issue when I compile to an executable via nuitka, e.g.:

python -m nuitka --follow-imports --standalone program.py

The exact same program.py throws no errors when I run it normally, but once it's migrated to an executable I get the following errors which essentially mirror the above description:

Exception ignored in: <compiled_function Spotify.__del__ at 0x000002566E6B3F10>
Traceback (most recent call last):
  File "C:\Users\<REDACTED>\AppData\Local\Temp\ONEFIL~1\spotipy\client.py", line 188, in __del__
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union
Exception ignored in: <compiled_function SpotifyAuthBase.__del__ at 0x000002566E7A8130>   
Traceback (most recent call last):
  File "C:\Users\<REDACTED>\AppData\Local\Temp\ONEFIL~1\spotipy\oauth2.py", line 156, in __del__
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union

This is with Python 2.10.3 and Spotipy 2.19.0 on Windows 10