class SerialPort(serialport.SerialPort):

    def _serialFactory(self, dev, *args, **kwargs):
        """ pyserial recommends the following for supporting serial urls """
try:
    return serial.serial_for_url(dev)
except AttributeError:
    pass
Use RFC2217 network serial ports with Twisted Python?