jplana / python-etcd

A python client for etcd
Other
522 stars 210 forks source link

Fix writing unicode strings as values with python 2.7 #255

Closed kkoppel closed 1 year ago

kkoppel commented 6 years ago

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.

lavagetto commented 1 year ago

@kkoppel do you still need this? I'm more inclined to just drop 2.7 support altogether.

kkoppel commented 1 year ago

No, I'm not using python 2.7 anymore.