Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Object of type Decimal is not JSON serializable #97

Open
devcxl opened this issue Apr 23, 2024 · 4 comments
Open

TypeError: Object of type Decimal is not JSON serializable #97

devcxl opened this issue Apr 23, 2024 · 4 comments

Comments

@devcxl
Copy link

devcxl commented Apr 23, 2024


2024-04-23T11:14:05.440428411Z │ │           o = [                                                          │ │
2024-04-23T11:14:05.440433580Z │ │               │   {                                                      │ │
2024-04-23T11:14:05.440438329Z │ │               │   │   'filename':                                        │ │
2024-04-23T11:14:05.440444615Z │ │               'ca57298e615ab2d4875db18590befaad.png',                    │ │
2024-04-23T11:14:05.440498394Z │ │               │   │   'data':                                           │ │
2024-04-23T11:14:05.440505169Z │ │               Decimal('1056218744737726101909875705338'),                │ │
2024-04-23T11:14:05.440536668Z │ │               │   }                                                      │ │
2024-04-23T11:14:05.440542954Z │ │               ]                                                          │ │
2024-04-23T11:14:05.440548541Z │ │        self = <json.encoder.JSONEncoder object at 0x7fc5aebe2690>        │ │
2024-04-23T11:14:05.440553779Z │ ╰──────────────────────────────────────────────────────────────────────────╯ │
2024-04-23T11:14:05.440559017Z │                                                                              │
2024-04-23T11:14:05.440562789Z │ /usr/local/lib/python3.12/json/encoder.py:180 in default                     │
2024-04-23T11:14:05.440568097Z │                                                                              │
2024-04-23T11:14:05.440572497Z │   177 │   │   │   │   return JSONEncoder.default(self, o)                    │
2024-04-23T11:14:05.440581926Z │   178 │   │                                                                  │
2024-04-23T11:14:05.440587094Z │   179 │   │   """                                                            │
2024-04-23T11:14:05.440592402Z │ ❱ 180 │   │   raise TypeError(f'Object of type {o.__class__.__name__} '      │
2024-04-23T11:14:05.440596663Z │   181 │   │   │   │   │   │   f'is not JSON serializable')                   │
2024-04-23T11:14:05.440602530Z │   182 │                                                                      │
2024-04-23T11:14:05.440608257Z │   183 │   def encode(self, o):                                               │
2024-04-23T11:14:05.440612936Z │                                                                              │
2024-04-23T11:14:05.440618104Z │ ╭────────────────────────── locals ──────────────────────────╮               │
2024-04-23T11:14:05.440623413Z │ │    o = Decimal('1056218744737726101909875705338')          │               │
2024-04-23T11:14:05.440628651Z │ │ self = <json.encoder.JSONEncoder object at 0x7fc5aebe2690> │               │
2024-04-23T11:14:05.440633051Z │ ╰────────────────────────────────────────────────────────────╯               │
2024-04-23T11:14:05.440639756Z ╰──────────────────────────────────────────────────────────────────────────────╯
2024-04-23T11:14:05.440644924Z TypeError: Object of type Decimal is not JSON serializable
2024-04-23T11:14:05.499338434Z Exception ignored in: <function StreamWriter.__del__ at 0x7fc5adf66480>
2024-04-23T11:14:05.499379851Z 
long2ice added a commit that referenced this issue Apr 23, 2024
@long2ice
Copy link
Owner

fixed

@ilogus
Copy link

ilogus commented May 22, 2024

Hi @long2ice, do you know how can we got this fix in the docker version, do you recommand us to build our own version with the latest fix ? Thx :)

@andrefrcastro
Copy link

We're also getting this error in the docker version

@devcxl
Copy link
Author

devcxl commented Sep 28, 2024

The long2ice/meilisync:dev image has already fixed this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants