Skip to content

AssertionError in libmodule-python when decoding the request. #70

@kaushal2161

Description

@kaushal2161

Hi, i am writing one module to give mathematical formula for given question but i am having some trouble with json decoder. i got following error when i tried to post request and also got 500 -Internal server error. My module is running completely fine with the use of classes to send request but with the use of post it gives error.
CMD :python3 -m ppp_cli --api "http://localhost:8080/" --parse "(ENS de Lyon, location, ?)"

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/kaushal/workspace1/askplatyp_formula_retrieval/ppp_cli/__main__.py", line 29, in <module>
    main.main(args.api, args.id, args.language, args.parse, args.request, args.dot)
  File "/home/kaushal/workspace1/askplatyp_formula_retrieval/ppp_cli/main.py", line 59, in main
    data = requests.post(api, data=request.as_json()).json()
  File "/home/kaushal/.local/lib/python3.5/site-packages/requests/models.py", line 826, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/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)

I have search for internal server error but nothing helped to solve my error.
Any suggestions how to deal with this problem?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions