De sua documentação :
The class will however, run the CGI script, instead of serving it as a file, if it guesses it to be a CGI script. Only directory-based CGI are used — the other common server configuration is to treat special extensions as denoting CGI scripts.
The
do_GET()
anddo_HEAD()
functions are modified to run CGI scripts and serve the output, instead of serving files, if the request leads to somewhere below thecgi_directories
path. [...]
cgi_directories
: This defaults to['/cgi-bin', '/htbin']
and describes directories to treat as containing CGI scripts.