Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json encode problem #129

Open
simonzen opened this issue Nov 25, 2021 · 0 comments
Open

json encode problem #129

simonzen opened this issue Nov 25, 2021 · 0 comments

Comments

@simonzen
Copy link

First, guys, thank you for the library - it's awwesome!
I use consul as a key/value storage and met the following problem.
In method consul_instance.kv.items() I got an error

Traceback (most recent call last):
File "/Users/sfokin/projects/eaas_libs/test.py", line 10, in
print(test_inst.kv.items())
File "/usr/local/lib/python3.9/site-packages/consulate/api/kv.py", line 181, in items
return [{item['Key']: item['Value']} for item in self._get_all_items()]
File "/usr/local/lib/python3.9/site-packages/consulate/api/kv.py", line 181, in
return [{item['Key']: item['Value']} for item in self._get_all_items()]
TypeError: string indices must be integers

It seems that in base.py in Response class we don't need to encode value = json.loads(body, encoding='utf-8') (line 140)
When I replaced it with this line value = json.loads(body) all worked correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant