Issue 33979: [Exception message] Display type of not JSON serializable object

Issue33979

Created on 2018-06-27 10:26 by Vayel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg320570 - (view) Author: Vincent Lefoulon (Vayel) Date: 2018-06-27 10:26
When we call `json.dumps` on a non JSON serializable object, we obtain an error:

```
TypeError: 4 is not JSON serializable
```

Here, 4 was actually a `numpy.int64` object and not a native int. But it is not explicit in the error message. We should mention the type of the object as well:

```
TypeError: 4 of type numpy.int64 is not JSON serializable
```
msg320571 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-27 11:17
This already changed in issue26623 and issue24641.

Python 3.5 now gets only security fixes.
History
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78160
2018-06-27 11:17:03serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg320571

resolution: out of date
stage: resolved

2018-06-27 10:27:11Vayelsettitle: Display type of not JSON serializable object -> [Exception message] Display type of not JSON serializable object
2018-06-27 10:26:14Vayelcreate