SwSpotify icon indicating copy to clipboard operation
SwSpotify copied to clipboard

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

Open Dylan1496 opened this issue 3 years ago • 2 comments

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):

  • OS: Arch Linux (kernel version: 5.17.7)
  • Browser: Brave
  • Version: 1.2.3 (also tested with the current AUR version, 1.2.1, to no avail)

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.

Dylan1496 avatar May 15 '22 16:05 Dylan1496

@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.

aadibajpai avatar May 15 '22 16:05 aadibajpai

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).

Dylan1496 avatar May 22 '22 13:05 Dylan1496