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

.all() not working #31

Closed
joamatab opened this issue Oct 17, 2019 · 2 comments
Closed

.all() not working #31

joamatab opened this issue Oct 17, 2019 · 2 comments

Comments

@joamatab
Copy link

Im using the latest version pip install git+https://github.com/Miserlou/NoDB.git

pip list | ag nodb
nodb                          0.4.0  

After the i run the example,

I tried to show all the values stored using nodb.all()

---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-3-9ca61584a6c9> in <module>
----> 1 nodb.all()

~/miniconda3/lib/python3.7/site-packages/nodb/__init__.py in all(self, metainfo)
    188             serialized = obj.get()["Body"].read()
    189             # deserialize and add to list
--> 190             deserialized_objects.append(self._deserialize(serialized))
    191 
    192         # sort by insert datetime

~/miniconda3/lib/python3.7/site-packages/nodb/__init__.py in _deserialize(self, serialized)
    236 
    237         obj = None
--> 238         deserialized = json.loads(serialized)
    239         return_me = {}
    240 

~/miniconda3/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    346             parse_int is None and parse_float is None and
    347             parse_constant is None and object_pairs_hook is None and not kw):
--> 348         return _default_decoder.decode(s)
    349     if cls is None:
    350         cls = JSONDecoder

~/miniconda3/lib/python3.7/json/decoder.py in decode(self, s, _w)
    338         end = _w(s, end).end()
    339         if end != len(s):
--> 340             raise JSONDecodeError("Extra data", s, end)
    341         return obj
    342 

JSONDecodeError: Extra data: line 1 column 3 (char 2)
@bendog
Copy link
Collaborator

bendog commented Oct 28, 2019

.all() is in 0.5.0 not 0.4.0

@bendog bendog closed this as completed Oct 28, 2019
@dschofield
Copy link

This is still an issue.

I've installed 0.5.1 from tag 0.5.1:
pipenv install git+https://github.com/Miserlou/NoDB.git@0.5.1#egg=nodb
or, locally from the 0.5.1 tarball.

(btw, the version in setup.py still shows 0.4.0)

nodb.all() returns the error

Traceback (most recent call last):
File "", line 1, in
File "/home/dschofield/clients/mdg/NoDB-0.5.1/nodb/init.py", line 202, in all
deserialized_objects.append(self._deserialize(serialized))
File "/home/dschofield/clients/mdg/NoDB-0.5.1/nodb/init.py", line 252, in _deserialize
deserialized = json.loads(serialized)
File "/usr/local/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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

3 participants