<div class="gmail_quote">Hi,<br><br>I am trying to test Google OpenID Auth with twill, but getting an unexpected URLError because of quotes in refresh url that google inserts in response's header (Refresh: 0; url='<a href="http://www.google.com/.." target="_blank">http://www.google.com/..</a>.' , notice single quotes). I don't know is it a google's bug or twill's feature :). I propose this simple patch:<br>
<br>--- /usr/lib/python2.5/site-packages/twill-0.9-py2.5.egg/twill/other_packages/_mechanize_dist/_request.py 2009-01-21 00:34:17.000000000 +0200<br>+++ /home/sergey/dev/sandbox/_request.py 2009-01-21 00:25:35.000000000 +0200<br>
@@ -31,7 +31,10 @@ class Request(urllib2.Request):<br> if not _rfc3986.is_clean_uri(url):<br> warn("url argument is not a URI "<br> "(contains illegal characters) %r" % url)<br>
- urllib2.Request.__init__(self, url, data, headers)<br>+ if url[0]=="'" and url[-1]=="'":<br>+ url = url[1:-1]<br>+<br>+ urllib2.Request.__init__(self, url, data, headers)<br>
self.selector = None<br> self.unredirected_hdrs = {}<br> self.visit = visit<br><br><br>Can anyone help me with not-so-dirty solution?<br><br>Regards,<br><font color="#888888">Sergey Kishchenko<br>
</font></div><br>