Issue26623
Created on 2016-03-23 14:48 by Mahmoud Lababidi, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| json_encode.patch | Mahmoud Lababidi, 2016-03-23 14:51 | review | ||
| json_encode.patch | Mahmoud Lababidi, 2016-04-04 17:22 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg262272 - (view) | Author: Mahmoud Lababidi (Mahmoud Lababidi) * | Date: 2016-03-23 14:48 | |
The json.dumps()/encode functionality will raise an Error when an object that cannot be json-encoded is encountered. The current Error message only shows the Object itself. I would like to enhance the error message by also providing the Type. This is useful when numpy.int objects are passed in, but not clear that they are numpy objects. |
|||
| msg262275 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2016-03-23 15:01 | |
I think it is better to remove the representation of the object at all. It can be too long and less informative that the type of the object. |
|||
| msg262679 - (view) | Author: Mahmoud Lababidi (Mahmoud Lababidi) * | Date: 2016-03-30 19:46 | |
Is there a use case where the representation is too long? I think it may be useful to see the representation, but perhaps you are correct. |
|||
| msg262857 - (view) | Author: Mahmoud Lababidi (Mahmoud Lababidi) * | Date: 2016-04-04 17:22 | |
Serhiy, I've attached a patch without the Object representation. Choose whichever you feel is better. |
|||
| msg263139 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2016-04-10 12:46 | |
> Is there a use case where the representation is too long? For example large bytes, bytearray or set object. |
|||
| msg263140 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2016-04-10 12:47 | |
New changeset cb1ad434f10e by Serhiy Storchaka in branch 'default': Issue #26623: TypeError message for JSON unserializible object now contains https://hg.python.org/cpython/rev/cb1ad434f10e |
|||
| msg263141 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2016-04-10 12:48 | |
Thank you for your contribution Mahmoud. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:28 | admin | set | github: 70810 |
| 2017-11-10 19:33:35 | serhiy.storchaka | link | issue31994 superseder |
| 2016-04-10 12:48:02 | serhiy.storchaka | set | status: open -> closed resolution: fixed messages: + msg263141 stage: resolved |
| 2016-04-10 12:47:15 | python-dev | set | nosy:
+ python-dev messages: + msg263140 |
| 2016-04-10 12:46:07 | serhiy.storchaka | set | messages: + msg263139 |
| 2016-04-10 12:40:32 | serhiy.storchaka | set | assignee: serhiy.storchaka |
| 2016-04-04 17:22:30 | Mahmoud Lababidi | set | files:
+ json_encode.patch messages: + msg262857 |
| 2016-03-30 19:46:16 | Mahmoud Lababidi | set | messages: + msg262679 |
| 2016-03-23 15:01:05 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg262275 |
| 2016-03-23 14:54:05 | SilentGhost | set | nosy:
+ rhettinger, pitrou, ezio.melotti |
| 2016-03-23 14:51:22 | Mahmoud Lababidi | set | files:
+ json_encode.patch keywords: + patch |
| 2016-03-23 14:48:20 | Mahmoud Lababidi | create | |

