From b71daad7fb6a8a0a9d47a29471c24989eabef88c Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Thu, 26 Dec 2024 09:46:22 -0500 Subject: [PATCH] Fixed Bazarr not starting when configured IP isn't available for binding. --- bazarr/app/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bazarr/app/server.py b/bazarr/app/server.py index 85c2eb680..11cadbe1c 100644 --- a/bazarr/app/server.py +++ b/bazarr/app/server.py @@ -49,12 +49,12 @@ class Server: threads=100) self.connected = True except OSError as error: - if error.errno == 49: + if error.errno == errno.EADDRNOTAVAIL: logging.exception("BAZARR cannot bind to specified IP, trying with 0.0.0.0") self.address = '0.0.0.0' self.connected = False super(Server, self).__init__() - elif error.errno == 48: + elif error.errno == errno.EADDRINUSE: if self.port != '6767': logging.exception("BAZARR cannot bind to specified TCP port, trying with default (6767)") self.port = '6767' @@ -64,7 +64,7 @@ class Server: logging.exception("BAZARR cannot bind to default TCP port (6767) because it's already in use, " "exiting...") self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR) - elif error.errno == 97: + elif error.errno == errno.ENOLINK: logging.exception("BAZARR cannot bind to IPv6 (*), trying with 0.0.0.0") self.address = '0.0.0.0' self.connected = False