Ignore shutdown exception in cheroot

This commit is contained in:
JonnyWong16 2024-06-18 19:19:18 -07:00
commit 55573d26ea
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -19,6 +19,7 @@ import os
import ssl import ssl
import sys import sys
import cheroot.errors
import cherrypy import cherrypy
import plexpy import plexpy
@ -260,6 +261,13 @@ def initialize(options):
} }
} }
# Catch shutdown errors that can break cherrypy/cheroot
# See https://github.com/cherrypy/cheroot/issues/710
try:
cheroot.errors.acceptable_sock_shutdown_exceptions += (OSError,)
except AttributeError:
pass
cherrypy.tree.mount(WebInterface(), options['http_root'], config=conf) cherrypy.tree.mount(WebInterface(), options['http_root'], config=conf)
if plexpy.HTTP_ROOT != '/': if plexpy.HTTP_ROOT != '/':
cherrypy.tree.mount(BaseRedirect(), '/') cherrypy.tree.mount(BaseRedirect(), '/')