graphite-project / graphite-web

A highly scalable real-time graphing system
http://graphite.readthedocs.org/
Apache License 2.0
5.89k stars 1.26k forks source link

Resolves #2692 can't unpickle Interval/IntervalSet #2693

Closed drawks closed 3 years ago

drawks commented 3 years ago

It took me a minute to figure this one out. So, the original code uses "old style" classes which means that the __slots__ definition is a noop on python2, but on python3 you automatically get new style classes. Really this should be updated to use "new style" classes, but that would suddenly create compatibility issues between older versions of graphite-web AND also software such as carbonapi which works by mimicking the existing graphite-web behavior. By removing the __slots__ we get identical behavior on python2 and python3 which is a vanilla unslotted class instance that unpickles fine in both pyhton2 and python3 and works with carbonapi too.

lgtm-com[bot] commented 3 years ago

This pull request fixes 2 alerts when merging 532c6e62fa4ecccd64a2728af8c15647a68728b1 into 1ca8e602c15ba9ed7737976d01c9d1ba10eafa40 - view on LGTM.com

fixed alerts:

deniszh commented 3 years ago

Geez, thanks, @drawks ! LGTM directly reports that as error 🤦