<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.&nbsp; Different sets of error messages were given.<br>  (Also easier to find after Tommy V encouraged me to inspect my code<br>  more carefully :&gt;)<br>  <br>  Stephen Nightingale.<br>  <br>  <br><b><i>Tommi Virtanen &lt;tv@twistedmatrix.com&gt;</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>&gt; <br>&gt; Fine Book.  I'm working through the examples.<br>&gt; Hit a problem with the wordcountproxy.py example,<br>&gt; under the explanation of HTTP Proxy Servers, on page 62..<br>&gt; As this __might__ be an issue with Twisted itself,<br>&gt; I'm cross-posting
 here as well as back to O'Reilly errata.<br>&gt; <br>&gt; The issue is that the:<br>&gt; 'reactor.listenTCP(WEB_PORT, WebReportFactory(counter))'<br>&gt; call precipitates an error message in  _getfullpathname in<br>&gt; Lib/ntpath.py, called from web/http.py, and the error is:<br>&gt; 'TypeError: coercing to Unicode: need string or buffer, WordCounter<br>&gt; found'<br>...<br>&gt; I wonder if anyone else has come across this issue?<br>&gt; 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>