From fcdd9295b4221839aaac0d17f3caf38d3fc3767b Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 21 Feb 2019 20:53:21 -0300 Subject: [PATCH] delete upon failing to decode JSON from sd blob --- lbrynet/stream/descriptor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lbrynet/stream/descriptor.py b/lbrynet/stream/descriptor.py index 80d067ca4..d73369110 100644 --- a/lbrynet/stream/descriptor.py +++ b/lbrynet/stream/descriptor.py @@ -134,6 +134,7 @@ class StreamDescriptor: try: decoded = json.loads(json_bytes.decode()) except json.JSONDecodeError: + blob.delete() raise InvalidStreamDescriptorError("Does not decode as valid JSON") if decoded['blobs'][-1]['length'] != 0: raise InvalidStreamDescriptorError("Does not end with a zero-length blob.")