you're doing it wrong
-g is used to point to the GPIO file directly, not a folder. In your case it should be "GPIO-STM32F103x8_gpio_v1_0_Modes.xml" (find the file in cubemx folder and paste it in the same folder as the script)
use -h to get information about the parameters.
I just updated the script, can you retest? (not the compiled version, you need python)