python-mechanize doesn't work in python2.6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu One Servers |
Fix Released
|
Undecided
|
Unassigned | ||
python-mechanize (Ubuntu) |
Fix Released
|
High
|
Ken VanDine |
Bug Description
Binary package hint: python-mechanize
This is different from the very-recently-fixed bug about mechanize not being able to be imported under python2.6
I'm running on jaunty, with:
python-mechanize:
Installed: 0.1.7b-3ubuntu1
python2.6:
Installed: 2.6.1-1ubuntu1
Here is an example showing how mechanize doesn't work:
Python 2.6.1+ (r261:67515, Mar 2 2009, 13:10:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mechanize import Browser
/usr/lib/
import re, base64, urlparse, posixpath, md5, sha, sys, copy
/usr/lib/
import re, base64, urlparse, posixpath, md5, sha, sys, copy
>>> b = Browser()
>>> b.open('http://
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
return self._mech_
File "/usr/lib/
response = UserAgentBase.
File "/usr/lib/
req = meth(req)
File "/usr/lib/
self.rfp.read()
File "/usr/lib/
robotparser
AttributeError: 'module' object has no attribute '_debug'
In some more involved code, I'm also hitting problems with missing timeout attributes, and this issue is described as fixed in the 0.1.10 changelog for mechanize:
2008-12-03 John J Lee <email address hidden>
* 0.1.10 release.
* Add support for Python 2.6: Raise URLError on file: URL errors,
not IOError (port of upstream urllib2 fix). Add support for
Python 2.6's per-connection timeouts: Add timeout arguments to
urlopen(), Request constructor, .open(), and .open_novisit().
(from http://
It seems like the best course of action here is to update to the newer 0.1.11 release of python-mechanize, rather than to try picking out all the python2.6 compatibility fixes and apply them to the old release. mechanize 0.1.7b is from mid 2007, it's pretty old.
Changed in python-mechanize: | |
status: | New → In Progress |
ken mentioned on IRC he would be willing to prepare a new package and propose it, I guess it would also need to go through the process for a version freeze exception?