<div id="RTEContent"><br><br> Ahh,<br> <br> It works better when I use 'class WordCountProxyClient'<br> instead of 'class WordCountProxy'.<br> <br> Sorry to have troubled you.<br> <br> Though I must say, the real problem was easier to find when I ran it on Linux, than on XP. Different sets of error messages were given.<br> (Also easier to find after Tommy V encouraged me to inspect my code<br> more carefully :>)<br> <br> Stephen Nightingale.<br> <br> <br><b><i>Tommi Virtanen <tv@twistedmatrix.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Tue, 2005-11-22 at 00:59 +0000, Stephen Nightingale wrote:<br>> <br>> Fine Book. I'm working through the examples.<br>> Hit a problem with the wordcountproxy.py example,<br>> under the explanation of HTTP Proxy Servers, on page 62..<br>> As this __might__ be an issue with Twisted itself,<br>> I'm cross-posting
here as well as back to O'Reilly errata.<br>> <br>> The issue is that the:<br>> 'reactor.listenTCP(WEB_PORT, WebReportFactory(counter))'<br>> call precipitates an error message in _getfullpathname in<br>> Lib/ntpath.py, called from web/http.py, and the error is:<br>> 'TypeError: coercing to Unicode: need string or buffer, WordCounter<br>> found'<br>...<br>> I wonder if anyone else has come across this issue?<br>> Any insights gratefully received,<br><br>Did you type it in yourself? It seems like the wordCounter<br>argument to WebReportFactory.__init__ is getting to<br>HTTPFactory.__init__, which seems to think it is logPath.<br>But the book I have in front of me seems to be correct:<br><br>class WebReportFactory(http.HTTPFactory):<br> def __init__(self, wordCounter):<br> self.wordCounter = wordCounter<br> http.HTTPFactory.__init__(self)<br>...<br> counter = WordCounter()<br>...<br> reactor.listenTCP(WEB_PORT,
WebReportFactory(counter))<br><br><br><br></blockquote><br></div><p>
                <hr size=1>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<a href="http://us.rd.yahoo.com/mail/uk/taglines/yahoo_co_uk/cars/*http://uk.cars.yahoo.com/features/competitions/vespa.html">Win a Yahoo! Vespa</a>
<font color="red">NEW</font> - Yahoo! Cars has 3 Vespa LX125s to be won
<a href="http://us.rd.yahoo.com/mail/uk/taglines/yahoo_co_uk/cars/*http://uk.cars.yahoo.com/features/competitions/vespa.html">Enter Now!</a>
</font>