iamkubi / pydactyl

Python wrapper for the Pterodactyl Panel API
MIT License
69 stars 21 forks source link

send_power_action start stack traces on success #1

Closed iamkubi closed 5 years ago

iamkubi commented 5 years ago

Per my own docstring on success the response body will be empty. Seems like it's failing to decode the response.

client.client.send_power_action(id, 'start')

Traceback (most recent call last): File "", line 1, in File "D:\code\pydactyl\pydactyl\api\client.py", line 82, in send_power_action data=data) File "D:\code\pydactyl\pydactyl\api\base.py", line 94, in _api_request return response.json() File "D:\code\pydactyl\venv\lib\site-packages\requests\models.py", line 895, in json return complexjson.loads(self.text, **kwargs) File "D:\Program Files\Python36\lib\json__init__.py", line 354, in loads return _default_decoder.decode(s) File "D:\Program Files\Python36\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "D:\Program Files\Python36\lib\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)

iamkubi commented 5 years ago

Fixed by https://github.com/iamkubi/pydactyl/commit/7fb764d8c06c8be17f0ceb77e652b5921128c97b

client.client.send_power_action(srv_id, 'start')
<Response [204]>