telepathy-python: on service side, consider having SetAvatar default to byte_arrays=True
Submitted by Simon McVittie
Assigned to Telepathy bugs list
Description
12:15 < smcv>
asabil, Zdra: if you want to know more about ByteArray vs Array
in Python, consult
http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#return-values-and-the-byte-arrays-and-utf8-strings-options
12:16 < asabil>
smcv, it seems that a small change would be very welcome in
tp-python
12:16 < smcv>
Array of Byte is consistent with the rest of the API, so it's the
default - ByteArray is usually more useful though
12:16 < smcv>
asabil: what change?
12:16 < asabil>
adding the byte_array=True to the decorator
12:16 < smcv>
eek aagh urgh
12:16 < smcv>
there's a reason it's not the default
12:17 < asabil>
which is?
12:17 < smcv>
it's completely inconsistent with any other D-Bus array type
12:17 < asabil>
yes and ?
12:17 < asabil>
adding it to SetAvatar only would be quite useful
12:17 < smcv>
the default ought to be consistent - least astonishment and all
that
12:17 < smcv>
is this on the client side, or on the server side?
12:18 < asabil>
server side
12:18 < smcv>
hmm...
12:18 < asabil>
because under python we always handle binary blobs as strings
12:18 < smcv>
yeah, that's why ByteArray exists
12:19 < asabil>
so when you Set an Avatar I expect it to be a binary blob
12:19 < asabil>
ie. a string
12:19 < smcv>
hmm
12:19 < smcv>
least astonishment vs the default being the right thing...
12:20 < smcv>
perhaps you're right, the default should be Array of Byte but in
telepathy-python we know that ByteArray is more useful
12:20 < smcv>
s/the default/the dbus-python default/
12:20 < asabil>
I would say that as well