From 55573d26eaa7d9f98a84215c757a5b5b2030ce52 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:19:18 -0700 Subject: [PATCH] Ignore shutdown exception in cheroot --- plexpy/webstart.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plexpy/webstart.py b/plexpy/webstart.py index 62ab41ae..8a6edc6e 100644 --- a/plexpy/webstart.py +++ b/plexpy/webstart.py @@ -19,6 +19,7 @@ import os import ssl import sys +import cheroot.errors import cherrypy 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) if plexpy.HTTP_ROOT != '/': cherrypy.tree.mount(BaseRedirect(), '/')