digitalocean / digitalocean/pydo

invoices.get_csv_by_uuid fails with JSONDecodeError

Open
#465 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
140
Forks
68
Avg merge
9h 52m
Merged PRs (30d)
7

Description

Hello DigitalOcean,

```
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
[](https://localhost:8080/#) in ()
24 print(latest_uuid)
25
---> 26 invoice_resp = client.invoices.get_csv_by_uuid(latest_uuid)
27 invoice_resp

5 frames
[/usr/lib/python3.11/json/decoder.py](https://localhost:8080/#) in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```

I suspect this call fails because the API command returns a string and not JSON.

`get_by_uuid` for the same invoice UUID has no issues, likely because the response is JSON.

Thanks for your consideration of this issue.

Mike

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.