Index: buildbot/changes/bonsaipoller.py
===================================================================
RCS file: /cvsroot/mozilla/tools/buildbot/buildbot/changes/bonsaipoller.py,v
retrieving revision 1.5
diff -u -r1.5 bonsaipoller.py
--- buildbot/changes/bonsaipoller.py	26 Jul 2007 12:52:09 -0000	1.5
+++ buildbot/changes/bonsaipoller.py	26 Jul 2007 18:24:50 -0000
@@ -1,10 +1,10 @@
 import time
-from urllib import urlopen
 from xml.dom import minidom, Node
 
 from twisted.python import log, failure
 from twisted.internet import defer, reactor
 from twisted.internet.task import LoopingCall
+from twisted.web.client import getPage
 
 from buildbot.changes import base, changes
 
@@ -64,14 +64,12 @@
 class BonsaiParser:
     """I parse the XML result from a bonsai cvsquery."""
 
-    def __init__(self, bonsaiQuery):
+    def __init__(self, data):
         try:
         # this is a fix for non-ascii characters
-        # readlines() + join is being used because read() is not guaranteed
-        # to work. because bonsai does not give us an encoding to work with
+        # because bonsai does not give us an encoding to work with
         # it impossible to be 100% sure what to decode it as but latin1 covers
         # the broadest base
-            data = "".join(bonsaiQuery.readlines())
             data = data.decode("latin1")
             data = data.encode("ascii", "replace")
             self.dom = minidom.parseString(data)
@@ -290,7 +288,7 @@
 
         self.lastPoll = time.time()
         # get the page, in XML format
-        return defer.maybeDeferred(urlopen, url)
+        return getPage(url, timeout=self.pollInterval)
 
     def _process_changes(self, query):
         try:

