# Unexpected error in lgpio.py?

**URL:** <https://forums.pimoroni.com/t/unexpected-error-in-lgpio-py/28872>\
**Category:** Support\
**Created:** [May 20, 2026, 5:25pm UTC](https://forums.pimoroni.com/t/unexpected-error-in-lgpio-py/28872 "2026-05-20T17:25:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jert47](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jert47](https://forums.pimoroni.com/u/jert47)\
**Post date:** [May 20, 2026, 5:25pm UTC](https://forums.pimoroni.com/t/unexpected-error-in-lgpio-py/28872/1 "2026-05-20T17:25:43Z")

</div>

Hi, I’m a newbie in the Trilobot territory. When I try to run the flash\_underlight.py example, the script loops 10 times as it should. But after Done is printed, I get these strange error messages:

Done  
Exception ignored in: \<function PWM. **del** at 0x76662898\>  
Traceback (most recent call last):  
File “/usr/lib/python3/dist-packages/RPi/GPIO/ **init**.py”, line 179, in **del**  
File “/usr/lib/python3/dist-packages/RPi/GPIO/ **init**.py”, line 202, in stop  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 1084, in tx\_pwm  
TypeError: unsupported operand type(s) for &: ‘NoneType’ and ‘int’

8 times.

Can anybody help me understand what’s going on?

---

<div class="post-metadata">

**Author:** ![jert47](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jert47](https://forums.pimoroni.com/u/jert47)\
**Post date:** [May 22, 2026, 9:59am UTC](https://forums.pimoroni.com/t/unexpected-error-in-lgpio-py/28872/2 "2026-05-22T09:59:37Z")

</div>

Since nobody has answered my question, I myself am writing this comment: it is a problem with Bookworm. With Bullseye the scripts run smoothly.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [May 23, 2026, 10:02pm UTC](https://forums.pimoroni.com/t/unexpected-error-in-lgpio-py/28872/3 "2026-05-23T22:02:27Z")

</div>

Sometimes the Latest & Greatest, isn’t always the Greatest. ;)  
I run Bullseye on my Grow Hat Mini setups because of similar issues to what you posted. It’s not a big deal now that I know what OS will work with that hardware / software. It did have me scratching my chin for a bit though. :)
