def translate_path(self, path): """For paths starting with /cgi-bin/, serve from cgi_dir""" elts = path.split('/') if len(elts) > 1 and elts[0] == '': if elts[1] == 'cpython_site_packages': elts[-1] = elts[-1].split("?")[0] return os.path.join(cpython_site_packages, *elts[2:]) return CGIHTTPRequestHandler.translate_path(self, path)
def translate_path(self, path): """For paths starting with /cgi-bin/, serve from cgi_dir""" elts = path.split('/') if len(elts) > 1 and elts[0] == '' and elts[1] == 'cgi-bin': return os.path.join(cgi_dir, *elts[2:]) return CGIHTTPRequestHandler.translate_path(self, path)