2010-07-07 190 views
2

我寫了一個Twisted Python HTTP代理,並在通過代理導航到頁面後繼續獲得以下回溯。Twisted Web Proxy Help!

Traceback (most recent call last): 
    File "C:\ZBrownTechnology\Web Lock\Proxy.py", line 57, in <module> 
    reactor.run() 
    File "C:\Python26\lib\site-packages\twisted\internet\base.py", line 1165, in run 
    self.mainLoop() 
    File "C:\Python26\lib\site-packages\twisted\internet\base.py", line 1177, in mainLoop 
    self.doIteration(t) 
    File "C:\Python26\lib\site-packages\twisted\internet\selectreactor.py", line 140, in doSelect 
    _logrun(selectable, _drdw, selectable, method, dict) 
--- <exception caught here> --- 
    File "C:\Python26\lib\site-packages\twisted\python\log.py", line 84, in callWithLogger 
return callWithContext({"system": lp}, func, *args, **kw) 
    File "C:\Python26\lib\site-packages\twisted\python\log.py", line 69, in callWithContext 
    return context.call({ILogContext: newCtx}, func, *args, **kw) 
    File "C:\Python26\lib\site-packages\twisted\python\context.py", line 59, in ca 
llWithContext 
    return self.currentContext().callWithContext(ctx, func, *args, **kw) 
    File "C:\Python26\lib\site-packages\twisted\python\context.py", line 37, in callWithContext 
    return func(*args,**kw) 
    File "C:\Python26\lib\site-packages\twisted\internet\selectreactor.py", line 156, in _doReadOrWrite 
    self._disconnectSelectable(selectable, why, method=="doRead") 
    File "C:\Python26\lib\site-packages\twisted\internet\posixbase.py", line 250, 
in _disconnectSelectable 
    selectable.readConnectionLost(f) 
    File "C:\Python26\lib\site-packages\twisted\internet\tcp.py", line 508, in readConnectionLost 
    self.connectionLost(reason) 
    File "C:\Python26\lib\site-packages\twisted\internet\tcp.py", line 677, in connectionLost 
    Connection.connectionLost(self, reason) 
    File "C:\Python26\lib\site-packages\twisted\internet\tcp.py", line 519, in connectionLost 
    protocol.connectionLost(reason) 
    File "C:\Python26\lib\site-packages\twisted\web\http.py", line 489, in connectionLost 
    self.handleResponseEnd() 
    File "C:\Python26\lib\site-packages\twisted\web\proxy.py", line 88, in handleResponseEnd 
    self.father.finish() 
    File "C:\Python26\lib\site-packages\twisted\web\http.py", line 900, in finish 
    "Request.finish called on a request after its connection was lost; " 
exceptions.RuntimeError: Request.finish called on a request after its connection 
was lost; use Request.notifyFinish to keep track of this. 

這是什麼意思?我如何解決它?這是模塊問題還是我的代碼中的問題?我在使用Python 2.6的Windows XP上運行

回答

3

這是twisted.web.proxy中的known bug。它通常是無害的。如果它對您造成問題,請考慮提供補丁來修復它!

+0

目前我無法沉默它嗎?我需要在代理中運行代理,但如果出現錯誤,它將顯示它們。現在,它也一旦開始顯示這個錯誤,給使用代理的用戶提供瀏覽器錯誤。 Internet Explorer無法顯示該網頁。這是錯誤的一部分嗎?知道寫一個代理的更好方法嗎? – 2010-07-08 19:26:56

+0

如果有人感興趣,我能夠爲這個錯誤提供一個臨時補丁。我剛剛註釋掉了模塊中引起錯誤的代碼行。現在就像一個魅力! – 2010-07-09 17:51:48

+0

這並沒有解決這個錯誤,它引入了一個不同的:)。但請繼續討論JP鏈接到跟蹤器的錯誤。 – Glyph 2013-07-29 22:28:29