<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
twill experts,<br><br>I also posted this on StackOverflow, if you like to reply there:<br><a href="http://stackoverflow.com/questions/7278103/using-twills-builtin-mechanize-distribution-throws-attributeerror-on-debug">http://stackoverflow.com/questions/7278103/using-twills-builtin-mechanize-distribution-throws-attributeerror-on-debug</a><br><br><b>Using twill's builtin mechanize distribution throws AttributeError on _debug?</b><br><br>I use twill (0.9) and I want to also access its builtin mechanize distribution (on Python 2.6.6).<br>I read all the documentation and I'm not clear whether they even support or recommend that, if so they certainly don't publicize it (you might like to document that).<br>It seems you can do:<br><br>&nbsp;&nbsp;&nbsp; import _mechanize_dist as mechanize<br>&nbsp;&nbsp;&nbsp; br = mechanize.Browser()<br>&nbsp;&nbsp;&nbsp; br.open('http://www.yahoo.com')<br><br>however mechanize throws the stupid AttributeError below on `robotparser._debug`. Should I not be trying to use it? or is it a 2.5/2.6 incompatibility?<br>(Twill itself works fine: `twill.commands.go('http://www.yahoo.com')`)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Traceback (most recent call last):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "&lt;pyshell#19&gt;", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; br.open('http://www.yahoo.com')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "C:\Dev\Python26\lib\site-packages\twill-0.9-py2.6.egg\twill\other_packages\_mechanize_dist\_mechanize.py", line 212, in open<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self._mech_open(url, data)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "C:\Dev\Python26\lib\site-packages\twill-0.9-py2.6.egg\twill\other_packages\_mechanize_dist\_mechanize.py", line 238, in _mech_open<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response = UserAgentBase.open(self, request, data)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "C:\Dev\Python26\lib\site-packages\twill-0.9-py2.6.egg\twill\other_packages\_mechanize_dist\_opener.py", line 175, in open<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; req = meth(req)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "C:\Dev\Python26\lib\site-packages\twill-0.9-py2.6.egg\twill\other_packages\_mechanize_dist\_http.py", line 440, in http_request<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.rfp.read()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File "C:\Dev\Python26\lib\site-packages\twill-0.9-py2.6.egg\twill\other_packages\_mechanize_dist\_http.py", line 387, in read<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; robotparser._debug("parse lines")<br>&nbsp;&nbsp;&nbsp; AttributeError: 'module' object has no attribute '_debug'<br><br>(Last question is: I'm not aware of any caveats about using both twill and mechanize commands side-by-side?)<br><br>Thanks,<br>Stephen<br>                                               </div></body>
</html>