Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9346854
D559.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
696 B
Subscribers
None
D559.diff
View Options
diff --git a/swh/core/serializers.py b/swh/core/serializers.py
--- a/swh/core/serializers.py
+++ b/swh/core/serializers.py
@@ -178,7 +178,11 @@
if b'__uuid__' in obj and obj[b'__uuid__']:
return UUID(obj[b's'])
if b'__timedelta__' in obj and obj[b'__timedelta__']:
- return datetime.timedelta(**obj[b's'])
+ # for backward compatibility with old serialization method
+ if isinstance(obj[b's'], str):
+ return eval(obj[b's'])
+ else:
+ return datetime.timedelta(**obj[b's'])
if b'__arrow__' in obj and obj[b'__arrow__']:
return arrow.get(obj[b's'])
return obj
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 4:33 PM (3 w, 6 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222642
Attached To
D559: serializers: Ensure backward compatibility for string serialized timedeltas
Event Timeline
Log In to Comment