kapi2289 / vulcan-api

Unofficial UONET+ e-register API
https://vulcan-api.readthedocs.io/
MIT License
72 stars 17 forks source link

JSON parser crash while fetching "-" (dash sign) from register #19

Closed septicwolf818 closed 5 years ago

septicwolf818 commented 5 years ago
Traceback (most recent call last):
  File "D:\Python\lib\site-packages\vulcan\_vulcan.py", line 152, in _request
    return r.json()
  File "D:\Python\lib\site-packages\requests\models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "D:\Python\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "D:\Python\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Python\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\rafal\Documents\py-dzienniczek\main.py", line 20, in <module>
    klient.ustaw_ucznia(uczen)
  File "D:\Python\lib\site-packages\vulcan\_vulcan.py", line 189, in ustaw_ucznia
    self._dict = self._get_dict()
  File "D:\Python\lib\site-packages\vulcan\_vulcan.py", line 165, in _get_dict
    j = self._post("Uczen/Slowniki")
  File "D:\Python\lib\site-packages\vulcan\_vulcan.py", line 162, in _post
    return self._request("POST", endpoint, json=json, as_json=as_json, **kwargs)
  File "D:\Python\lib\site-packages\vulcan\_vulcan.py", line 154, in _request
    raise VulcanAPIException("Wystąpił błąd.")
vulcan._utils.VulcanAPIException: Wystąpił błąd.

Error occured while downloading grades data. Error ocurrs when student has a "-" (dash sign) in grades.

kapi2289 commented 5 years ago

I've added debug logging in ab91306, can you get the version from master and see what output do you have? And tell me if this error is only in grades.

septicwolf818 commented 5 years ago

The error no longer appears - it was most likely repaired by Vulcan. It seems that this was not an API problem. Thank you for your answer and amazing job with this API.