The Delete Lights has been through a couple of versions. One version was definitely faulty, and may show its faults even more severely in P5. The attached text is a good version that does work on my P5/SR4. (I think I'm still on SR4, not 4.1; the About says 5.04.321) Take the text and rename it to DeleteLights.py.
My python page
My ShareCG freebies