IIS 6.1中使用Python / CGI的“错误文件描述符”错误
背景 : 我试图(强调“尝试”)通过IIS(6.1,Windows Server 2008 R1)设置一个应用程序,通过一个Python脚本路由所有请求。 最终目标是在服务器上创build一个非常轻量级的API。 基本上,我采取了以下步骤: 添加到Windows的CGIfunction 在默认网站下创build一个新的应用程序 添加一个处理程序映射,接受*并运行c:\Python27\python.exe -u "c:\inetpub\wwwroot\testapi\cgiadapter.py" 将应用程序的虚拟目录设置为testapi 将应用程序的物理path设置为c:\inetpub\wwwroot\testapi 做一个基本的testing,下面的脚本被testing和工作: import cgi, cgitb # Detailed error logging to screen cgitb.enable() # Output basic response print 'content-type:text/plain' print print 'Hello World' 然后,我尝试更新脚本以读取来自stdin的请求 import cgi, cgitb # Detailed error logging to screen cgitb.enable() # Attempt to read the raw request from […]