python-mechanize fails to import with python2.6

Bug #336225 reported by Joel Stanley
2
Affects Status Importance Assigned to Milestone
python-mechanize (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

Binary package hint: python-mechanize

$ python -c 'import mechanize'
/usr/lib/python2.6/dist-packages/mechanize/_auth.py:14: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import re, base64, urlparse, posixpath, md5, sha, sys, copy
/usr/lib/python2.6/dist-packages/mechanize/_auth.py:14: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import re, base64, urlparse, posixpath, md5, sha, sys, copy
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/mechanize/__init__.py", line 85, in <module>
    from _mechanize import __version__
  File "/usr/lib/python2.6/dist-packages/mechanize/_mechanize.py", line 14, in <module>
    from _useragent import UserAgentBase
  File "/usr/lib/python2.6/dist-packages/mechanize/_useragent.py", line 23, in <module>
    class UserAgentBase(_opener.OpenerDirector):
  File "/usr/lib/python2.6/dist-packages/mechanize/_useragent.py", line 53, in UserAgentBase
    "gopher": _urllib2.GopherHandler,
AttributeError: 'module' object has no attribute 'GopherHandler'

python-mechanize: 0.1.7b-3
python: 2.6.1-0ubuntu1

Upstream claims support for Python2.6. The current upstream version is 0.1.11

http://wwwsearch.sourceforge.net/mechanize/

Revision history for this message
Ben Crisford (bencrisford) wrote :

Please be more clear and specific and include what distrorelease you are running.

Changed in python-mechanize:
status: New → Incomplete
Revision history for this message
Joel Stanley (shenki) wrote :

I'm not sure how I could be "more clear and specific". Which part of my bug report do you not understand?

With Jaunty being the only release of Ubuntu that ships python2.6, that would be the release I am running.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Agreed. I think you provided sufficient information. We are in the middle of transitioning to Python 2.6 as the default Python in Jaunty and a number of modules are currently broken as a result. This is one of them.

Changed in python-mechanize:
status: Incomplete → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

This also breaks unrelated packages like calibre.

Changed in python-mechanize:
importance: Undecided → High
Martin Pitt (pitti)
Changed in python-mechanize:
assignee: nobody → pitti
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-mechanize - 0.1.7b-3ubuntu1

---------------
python-mechanize (0.1.7b-3ubuntu1) jaunty; urgency=low

  * Add drop-Gopher.dpatch: Drop GopherError and GopherHandler, since
    Python 2.6's version does not define that any more. (LP: #336225)
  * debian/rules: Use glob instead of hardcoded site-packages/, python2.6 uses
    dist-packages now.
  * debian/rules: Supply --install-layout=deb.

 -- Martin Pitt <email address hidden> Sun, 01 Mar 2009 18:17:43 +0100

Changed in python-mechanize:
status: In Progress → Fix Released
Revision history for this message
ericstob (erics-zillow) wrote :

This also causes failure in zope.testbrowser.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.