Stream-Framework icon indicating copy to clipboard operation
Stream-Framework copied to clipboard

Update activity_serializer.py

Open ammsa opened this issue 10 years ago • 3 comments

In the function dumps, we are joining the parts by a comma, which may not be the best delimiter in the loads function because extra_contexts may have string fields that contain commas,and since the input of the loads function is a plain string, the list 'parts' in loads would be greater than 5 elements.

if a user has an extra_context that contains a comma, pickle would throw an EOFError.

the update fetches the rest of the extra_context to be able to unpickle it using pickle.

ammsa avatar Nov 05 '14 07:11 ammsa

sorry for the extremely late reply. this PR seems to have a point but without any additional test the merge seems quite risky to me.

tbarbugli avatar Dec 28 '14 12:12 tbarbugli

I think that this pull request could be closed as this issue was handled in the following commit: https://github.com/tschellenbach/Stream-Framework/commit/1537cf89348d2ae6f46a54887db87996b086e6b1

Anislav avatar Apr 08 '15 19:04 Anislav

@AmmsA @tbarbugli

Just ran into this issue myself. Cleaner fix is to limit the split() to a fixed length on line 38:

parts = serialized_activity.split(',', 5) `

marcelchastain avatar Aug 09 '15 00:08 marcelchastain