While trying to send unicode strings to mosquitto with python client I get
the following:
TypeError: payload must be a string, bytearray, int, float or None.
how do I then submit unicode data?
Sasha Bolotnov
www.bolotnov.info
--
Mailing list: https://launchpad.net/~mosquitto-users
Post to :
Hi,
I'm not near a computer right now, but can you tell me what version of
python you are using and how you are creating the string?
Thanks,
Roger
On Feb 11, 2013 6:48 PM, "Alexander Bolotnov" wrote:
> While trying to send unicode strings to mosquitto with python client I get
> the following:
Hi,
I'm using 2.7 and it's a unicode string: u'привет' - I'm actually getting
them from my gtalk_daemon
type(message) will return unicode
I'm now using a dirty walkaround:
def send_message(self, topic, message):
if type(message) == unicode:
message = str(message).enc
Hi
> I'm now using a dirty walkaround:
>
> def send_message(self, topic, message):
> if type(message) == unicode:
> message = str(message).encode('string_escape')
> result, some_number = Client.mc.publish(topic, message)
mosquitto.py does actually support p
got you, so the following in publish():
if isinstance(payload, str) == True or isinstance(payload, bytearray) ==
True:
local_payload = payload
should actually be something like
if payload and type(payload) in (str, unicode, bytearray):
local_payload = payload
I guess
thanks,
Exactly. Note that this will fail on python3 though, because "unicode"
doesn't exist.
On Mon, Feb 11, 2013 at 9:32 PM, Alexander Bolotnov wrote:
> got you, so the following in publish():
>
> if isinstance(payload, str) == True or isinstance(payload, bytearray) ==
> True:
> local_paylo
Thanks for the reply, and I meant to follow up sooner. Does that mean that
every application that uses the SSL features of Mosquitto ships its own
copy of the certs file? (And by extension, that every app is independently
responsible for keeping that file up to date?)
On Tue, Feb 5, 2013 at 6:02
Hi Jack,
I've got a part written reply to you that I've not yet sent because
I'm not happy with it. Sorry about that, I'll try and sort it out as
soon as I can.
Cheers,
Roger
On Mon, Feb 11, 2013 at 10:04 PM, Jack O'Connor wrote:
> Thanks for the reply, and I meant to follow up sooner. Does th
8 matches
Mail list logo