mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-29 01:00:11 +02: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):
|
elif isinstance(obj, Exception):
|
||||||
return '{}: {}'.format(obj.__class__.__name__, obj)
|
return '{}: {}'.format(obj.__class__.__name__, obj)
|
||||||
|
|
||||||
|
elif isinstance(obj, Path):
|
||||||
|
return str(obj)
|
||||||
|
|
||||||
elif cls_name in ('dict_items', 'dict_keys', 'dict_values'):
|
elif cls_name in ('dict_items', 'dict_keys', 'dict_values'):
|
||||||
return tuple(obj)
|
return tuple(obj)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user