SwagLyrics / SwSpotify

Cross-platform library to get the currently playing song and artist from Spotify w/o using the API or the internet. Very fast.
MIT License
85 stars 12 forks source link

Werkzeug >=2.1.0 causes the web server to not function. #47

Open Dylan1496 opened 2 years ago

Dylan1496 commented 2 years ago

Describe the bug When running the SwSpotify web server or using the command line interface with a python-werkzeug package version 2.1.0 or greater, the web server fails with a runtime error stating that it is not running with the werkzeug server.

To Reproduce Steps to reproduce the behavior:

  1. Have python-werkzeug >= 2.1.0 installed
  2. Run swaglyrics

Expected behavior The server should come up in a new tab or in a terminal and supply lyrics.

Desktop (please complete the following information):

Additional context Werkzeug provides a warning when using a 2.0.x versioned package: /usr/lib/python3.10/site-packages/SwSpotify/web_server.py:48: UserWarning: The 'environ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1.

The documentation for werkzeug shows the proper way to do the shutdown: https://werkzeug.palletsprojects.com/en/2.1.x/serving/#shutting-down-the-server

So until a fix is provided the only way to use this is to downgrade workzeug to 2.0.3 and add it to IgnorePkg (on Arch Linux at least, I am not sure about other Linux distros). The same message regarding deprecation appears on Windows as well, however, pip prevents the upgrade to 2.1.x.

aadibajpai commented 2 years ago

@Dylan1496 I knew the deprecation warning would eventually turn into a problem but they did not have good documentation back then. Would you like to pr with the fix and I will gladly merge it and upstream everything to all pip, arch and nix repos.

Dylan1496 commented 2 years ago

I did try fixing it, however, all my attempts results in the server coming up but without anything being displayed (except for a new tab that is either a white or black screen).