# Buggy code
def __init__(
    self, context, framer=None, identity=None, address=None, handler=None, **kwargs
):
    """Overloaded initializer for the socket server

    If the identify structure is not passed in, the ModbusControlBlock
    uses its own empty structure.

    :param context: The ModbusServerContext datastore
    :param framer: The framer strategy to use
    :param identity: An optional identify structure
    :param address: An optional (interface, port) to bind to.
    :param handler: A handler for each client session; default is
                        ModbusDisonnectedRequestHandler
    :param ignore_missing_slaves: True to not send errors on a request
                                    to a missing slave
    """
    self.threads = []
    self.decoder = ServerDecoder()
    self.framer = framer or ModbusSocketFramer
    self.context = context or ModbusServerContext()
    self.control = ModbusControlBlock()
    self.address = address or ("", Defaults.Port)
    self.handler = handler or ModbusDisconnectedRequestHandler
    self.ignore_missing_slaves = kwargs.get(
        "ignore_missing_slaves", Defaults.IgnoreMissingSlaves
    )

    if isinstance(identity, ModbusDeviceIdentification):
        self.control.Identity.update(identity)

    socketserver.ThreadingUDPServer.__init__(self, self.address, self.handler)


# Traceback (AttributeError)
client = ModbusSerialClient(port='notexist', method='rtu')
client.connect()
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "lib/python3.6/site-packages/pymodbus/client/sync.py", line 476, in connect
self.socket.interCharTimeout = self.inter_char_timeout
AttributeError: 'NoneType' object has no attribute 'interCharTimeout'

# Fixed code
def __init__(
    self, context, framer=None, identity=None, address=None, handler=None, **kwargs
):
    """Overloaded initializer for the socket server

    If the identify structure is not passed in, the ModbusControlBlock
    uses its own empty structure.

    :param context: The ModbusServerContext datastore
    :param framer: The framer strategy to use
    :param identity: An optional identify structure
    :param address: An optional (interface, port) to bind to.
    :param handler: A handler for each client session; default is
                        ModbusDisonnectedRequestHandler
    :param ignore_missing_slaves: True to not send errors on a request
                        to a missing slave
    :param broadcast_enable: True to treat unit_id 0 as broadcast address,
                        False to treat 0 as any other unit_id
    """
    self.threads = []
    self.decoder = ServerDecoder()
    self.framer = framer or ModbusSocketFramer
    self.context = context or ModbusServerContext()
    self.control = ModbusControlBlock()
    self.address = address or ("", Defaults.Port)
    self.handler = handler or ModbusDisconnectedRequestHandler
    self.ignore_missing_slaves = kwargs.get(
        "ignore_missing_slaves", Defaults.IgnoreMissingSlaves
    )
    self.broadcast_enable = kwargs.get("broadcast_enable", Defaults.broadcast_enable)

    if isinstance(identity, ModbusDeviceIdentification):
        self.control.Identity.update(identity)

    socketserver.ThreadingUDPServer.__init__(self, self.address, self.handler)