2010-07-07 62 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