Skip to content

Flux python-api kvs issue #5199

Answered by chu11
mgt16-LANL asked this question in Q&A
Discussion options

You must be logged in to vote

Playing around, I also thought of a very stupid workaround. Since json is expected, could just quote the string. It's stupid and only works for this specific case, not the general case depending on what data you want to actually put in the KVS.

import flux
import flux.kvs

f = flux.Flux()
d = flux.kvs.KVSDir(f)

print(d['a']['b']['c'])
>flux kvs put a.b.c=foo
>flux python ./test.py
Traceback (most recent call last):
  File "./test.py", line 7, in <module>
    print(d['a']['b']['c'])
  File "/g/g0/achu/chaos/git/flux-framework/flux-core/src/bindings/python/flux/kvs.py", line 175, in __getitem__
    return get(self.fhdl, self.key_at(key))
  File "/g/g0/achu/chaos/git/flux-framework/flux-cor…

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by grondo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #5196 on May 24, 2023 13:59.