Dave Jones - 2019-01-31

I'm afraid GPIO34 is a valid GPIO number ... it's just not a physical one. That may sound like splitting hairs but there's actually precedent for using non-physical GPIO numbers. For instance, on the v1 camera module the camera's LED was controlled by toggling GPIO 5 (on older Pi models this wasn't present on the header), or GPIO 32 (for newer Pi models - again a pin that isn't present on the header). There are also GPIO pins on certain Pi models that can be used to control the "ACT" LED on the board.

Off the top of my head, I'm not sure what GPIO34 controls by default but it's presumably something vaguely important if toggling it caused things to start freezing. Anyway - while RPi.GPIO could check whether the requested GPIO is non-physical it would be removing functionality if it actively rejected requests to control non-physical GPIOs.