Correction: privmsg and rawsend must be unicode aware.
parent
5c347d82f7
commit
c8bd6830ee
14
irclib.py
14
irclib.py
|
|
@ -763,12 +763,12 @@ class ServerConnection(Connection):
|
||||||
def privmsg(self, target, text):
|
def privmsg(self, target, text):
|
||||||
"""Send a PRIVMSG command."""
|
"""Send a PRIVMSG command."""
|
||||||
# Should limit len(text) here!
|
# Should limit len(text) here!
|
||||||
self.send_raw("PRIVMSG %s :%s" % (target, text))
|
self.send_raw(u'PRIVMSG %s :%s' % (target, text))
|
||||||
|
|
||||||
def privmsg_many(self, targets, text):
|
def privmsg_many(self, targets, text):
|
||||||
"""Send a PRIVMSG command to multiple targets."""
|
"""Send a PRIVMSG command to multiple targets."""
|
||||||
# Should limit len(text) here!
|
# Should limit len(text) here!
|
||||||
self.send_raw("PRIVMSG %s :%s" % (",".join(targets), text))
|
self.send_raw(u'PRIVMSG %s :%s' % (','.join(targets), text))
|
||||||
|
|
||||||
def quit(self, message=""):
|
def quit(self, message=""):
|
||||||
"""Send a QUIT command."""
|
"""Send a QUIT command."""
|
||||||
|
|
@ -782,17 +782,17 @@ class ServerConnection(Connection):
|
||||||
The string will be padded with appropriate CR LF.
|
The string will be padded with appropriate CR LF.
|
||||||
"""
|
"""
|
||||||
if self.socket is None:
|
if self.socket is None:
|
||||||
raise ServerNotConnectedError, "Not connected."
|
raise ServerNotConnectedError, u'Not connected.'
|
||||||
try:
|
try:
|
||||||
if self.ssl:
|
if self.ssl:
|
||||||
self.ssl.write(string + "\r\n")
|
self.ssl.write(string + u'\r\n')
|
||||||
else:
|
else:
|
||||||
self.socket.send(string + "\r\n")
|
self.socket.send(string + u'\r\n')
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print "TO SERVER:", string
|
print u'TO SERVER:', string
|
||||||
except socket.error, x:
|
except socket.error, x:
|
||||||
# Ouch!
|
# Ouch!
|
||||||
self.disconnect("Connection reset by peer.")
|
self.disconnect(u'Connection reset by peer.')
|
||||||
|
|
||||||
def squit(self, server, comment=""):
|
def squit(self, server, comment=""):
|
||||||
"""Send an SQUIT command."""
|
"""Send an SQUIT command."""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue