mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-01-03 09:25:42 +10:00
add support for Paths in json encoder
This commit is contained in:
committed by
Cristian Vargas
parent
abf68e5437
commit
008769d296
@@ -276,7 +276,10 @@ class ExtendedEncoder(pyjson.JSONEncoder):
|
||||
|
||||
elif isinstance(obj, Exception):
|
||||
return '{}: {}'.format(obj.__class__.__name__, obj)
|
||||
|
||||
|
||||
elif isinstance(obj, Path):
|
||||
return str(obj)
|
||||
|
||||
elif cls_name in ('dict_items', 'dict_keys', 'dict_values'):
|
||||
return tuple(obj)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user