MikeGawi / ePiframe

ePiframe is an e-Paper (or HDMI, Composite display) Raspberry Pi Photo Frame with Google Photos and more
GNU General Public License v3.0
66 stars 12 forks source link

TypeError: Object of type int64 is not JSON serializable #98

Closed MikeGawi closed 8 months ago

MikeGawi commented 8 months ago

According to #89, there's a bug in saving index when randomization is enabled.

Traceback (most recent call last):
  File "/home/pi/epiframe10/./ePiframe.py", line 1108, in <module>
    EPiframe()
  File "/home/pi/epiframe10/./ePiframe.py", line 73, in __init__
    self.process_flow()
  File "/home/pi/epiframe10/./ePiframe.py", line 125, in process_flow
    self.process_file(
  File "/home/pi/epiframe10/./ePiframe.py", line 618, in process_file
    self.save_index()
  File "/home/pi/epiframe10/./ePiframe.py", line 625, in save_index
    self.index_manager.save()
  File "/home/pi/epiframe10/modules/indexmanager.py", line 33, in save
    json.dump({"id": self.__id, "index": self.__index}, file_data)
  File "/usr/lib/python3.9/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/usr/lib/python3.9/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.9/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.9/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type int64 is not JSON serializable`