python-etcd icon indicating copy to clipboard operation
python-etcd copied to clipboard

Fix writing unicode strings as values with python 2.7

Open kkoppel opened this issue 7 years ago • 0 comments

Under python 2.7 writing unicode strings as values to etcd fails as follows:

import etcd
client = etcd.Client(host='127.0.0.1', port=2379)
client.write('/test/foo', u'õäö')

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

This seems to be all that is needed to fix that.

kkoppel avatar Jan 08 '18 14:01 kkoppel