You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
k, v = "foo", "bar"
...
client.put(k, v)
...
r = client.range(k).kvs[0].key
print(f"{r:<10}")
gets me
TypeError: unsupported format string passed to bytes.__format__
What I expected
I expected to be able to round-trip data through etcd without issue. As it is now, I have to explicitly cast everything back to str() if I want to use it in a format string like above.
The text was updated successfully, but these errors were encountered:
pjz
changed the title
Put in str, get out bytes ?
Put in str, got out bytes ?
Mar 27, 2019
Yes, that's a feature of etcd3:
Instead of etcd2 only accept ascii string as key and value,
the data type of etcd3's key&value are both binary data which is bytes in python3
so ... you have to manually convert it to str if you need.
pjz
changed the title
Put in str, got out bytes ?
Make obvious that etcd3 is binary-clean for keys and values, with .put() coerced to bytes
Mar 28, 2019
Description
I put a
str
into etcd and got outbytes
What I Did
gets me
TypeError: unsupported format string passed to bytes.__format__
What I expected
I expected to be able to round-trip data through etcd without issue. As it is now, I have to explicitly cast everything back to
str()
if I want to use it in a format string like above.The text was updated successfully, but these errors were encountered: