[New-bugs-announce] [issue33979] Display type of not JSON serializable object

Vincent Lefoulon report at bugs.python.org
Wed Jun 27 06:26:14 EDT 2018


New submission from Vincent Lefoulon <vincent.lefoulon at free.fr>:

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
```

----------
messages: 320570
nosy: Vayel
priority: normal
severity: normal
status: open
title: Display type of not JSON serializable object
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33979>
_______________________________________


More information about the New-bugs-announce mailing list