ESP32-Cam Camera Web Server compiler error

The line that generates the error is in a Python script that is part of the ESP32 boards platform's toolchain:
https://github.com/espressif/arduino-esp32/blob/1.0.6/tools/gen_esp32part.py#L536
but now that I look at the code, this is not actually the line that contains the problematic code. This is in a try ... except block and is only printing the exception that was raised somewhere else in the code.

Unfortunately, that "somewhere else" is the main() function, meaning the entire script!