2011-07-24 17 views
3

Windows 7のボックスにpython 3.2.1(32ビット)とcherrypy 3.2.1(CherryPy-3.2.1.win32-py3.exe)をインストールして、hello worldの例を試しました(PyScripter経由で実行されますが)エンジンバスのSTARTEDメッセージの後にハングします。Hello world failed

私はpython.exeを経由して、それを起動しようとすると、私は次のログを取得する:

C:\Program Files (x86)\Python32>python hello.py 
[24/Jul/2011:16:24:03] ENGINE Listening for SIGTERM. 
[24/Jul/2011:16:24:03] ENGINE Bus STARTING 
CherryPy Checker: 
The Application mounted at '' has an empty config. 

[24/Jul/2011:16:24:03] ENGINE Started monitor thread 'Autoreloader'. 
[24/Jul/2011:16:24:03] ENGINE Started monitor thread '_TimeoutMonitor'. 
[24/Jul/2011:16:24:03] ENGINE Serving on 127.0.0.1:8080 
[24/Jul/2011:16:24:03] ENGINE Bus STARTED 
Exception in thread CP Server Thread-4: 
Traceback (most recent call last): 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 693, in read_request_headers 
    read_headers(self.rfile, self.inheaders) 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 202, in read_headers 
    raise ValueError("Illegal end of headers.") 
ValueError: Illegal end of headers. 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 1024, in communicate 
    req.parse_request() 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 578, in parse_request 
    success = self.read_request_headers() 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 696, in read_request_headers 
    self.simple_response("400 Bad Request", ex.args[0]) 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 840, in simple_response 
    status = str(status) 
TypeError: 'tuple' object is not callable 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Program Files (x86)\Python32\lib\threading.py", line 736, in _bootstr 
ap_inner 
    self.run() 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 1174, in run 
    conn.communicate() 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 1080, in communicate 
    req.simple_response("500 Internal Server Error", format_exc()) 
    File "C:\Program Files (x86)\Python32\lib\site-packages\cherrypy\wsgiserver\ws 
giserver3.py", line 840, in simple_response 
    status = str(status) 
TypeError: 'tuple' object is not callable 

私は何をしないのですか?

コード:

import cherrypy 

class HelloWorld: 
    def index(self): 
     return "Hello world" 
    index.exposed = True 

cherrypy.quickstart(HelloWorld()) 

EDIT:ボーナス-情報:ノー結果と状況を改善するためにいろいろなことを試してみました。 cherrypyは64ビットをサポートしていないので、64ビットバージョンのPythonをインストールすることは役に立ちませんでした(私が間違っていない限り)。私はPythonとcherrypyパッケージの両方を再インストールしようとしましたが、私はそれをブロックする可能性のある他のすべてのものを無効にしようとしました(IIS)。すべての役に立たない:-(

EDIT2:2番目のボーナス - 私はそれがPython 2.7.2でインストールされていればすべて動作しますので、3.xの問題です。(3.0.1も試しました。スクリプトを起動する前にブラウザを開いて、あなたはどんな問題を持っていないでしょう

2 - -

1あなたがパーソナルファイアウォールまたは使用している場合:同じ問題)

答えて

2

は、私は2つのエラーが発生しました。あなたが8080ポートを保護していないことを確認してください。例えば、ESET Antivirusは8080を使用させず、CherryPyはポートがフリーではないと言います。

+0

これはpython 2.7.2で動作するので、どちらのsugggestionも成立しません。 – Goblin

+0

はPython 3でバイナリとテキストが分かれているので、WSGIとPython 3に問題があるのですが、それは問題だと思います。 http://en.wikipedia.org/wiki/Web_Server_Getway_Interface#WSGI_and_Python_3 知らないこの問題が解決されたら、私はPython 3とインターネットでちょうど始まるから。 – Abdelouahab

+0

ああありがとう!それは合理的だと思う - 私はちょうどpython3とウェブでも始めた:-) cherrypyは現在python3.xを実行している唯一のWebモジュールですので、彼らはそれを修正することを願って... – Goblin