socket is low-level, try putting b before the string like this:
sock.send(b"PRIVMSG #{} :{}\r\n".format(cfg.CHAN, msg))
Or by using .encode("utf-8") like this:
sock.send("PRIVMSG #{} :{}\r\n".format(cfg.CHAN, msg).encode("utf-8"))
socket is low-level, try putting b before the string like this:
sock.send(b"PRIVMSG #{} :{}\r\n".format(cfg.CHAN, msg))
Or by using .encode("utf-8") like this:
sock.send("PRIVMSG #{} :{}\r\n".format(cfg.CHAN, msg).encode("utf-8"))