2013-08-15 2 views
1

CGI 설정을 테스트하기 위해이 간단한 스크립트를 실행합니다.Python - CGI - (_urandom (16)), 16) WindowsError : [오류 5] 액세스가 거부되었습니다.

#!/usr/bin/python 

#import cgi 
print "Content-Type: text/plain\n\n" 

gender = "female" 

def display_vars (first_name, last_name, age): 
    print (first_name, last_name, age, gender) 

def go_display(): 
    gender = "male" 
    display_vars("John", "Smith", 22) 

go_display() 

그것은 작동 및 디스플레이 "('John', 'Smith', 22, 'female')"

변화 import cgi

과 실패에 #import cgi에서 위.

The specified CGI application misbehaved by not returning a complete set of HTTP headers. 

(_urandom(16)), 16) WindowsError: [Error 5] Access is denied 
+0

http://forums.iis.net/t/1192084.aspx/1 – mata

답변

1

: 제외시켰다하기 :이 작동

을 이 발견 한 것입니다 나를. 다른 답변이 있으면 알려주세요. 시도해 보겠습니다.

0

컨텐츠 유형 헤더 전에

print "HTTP/1.0 200 OK\n"; 

를 추가합니다. 오류 메시지를 Google에 보내야합니다.

http://support.microsoft.com/kb/145661

또한이 : NotImplementedError 제외 설정 random.py 섹션 - _urandom에서

http://forums.iis.net/t/1192084.aspx/1

+0

인쇄 "HTTP/1.0 200 OK \ n"을 사용하고 응용 프로그램 풀의 고급 설정에서로드 사용자 프로필을 true로 설정하는 데 오류가 이미 설정되었습니다. 참된. – user2686515

관련 문제