[openstack-dev] [Trove] Should we stop using wsgi-intercept, now that it imports from mechanize? this is really bad!

Thomas Goirand zigo at debian.org
Sat Jul 26 16:03:06 UTC 2014


Hi,

Trove is using wsgi-intercept. So it ended in the
global-requirements.txt. It was ok until what's below...

I was trying to fix this bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755315

then I realize that the last version had the fix for Python 3.4. So I
tried upgrading. But doing so, I have found out that wsgi-intercept now
imports mechanize.

The mechanize package from pypi is in a *very* bad state. It embeds all
sorts of Python modules, like request, rfc3986, urllib2, beautifulsoup,
and probably a lot more. It also isn't Python 3 compatible. I tried
patching it. I ended up with:

 _beautifulsoup.py |   12 ++++++------
 _form.py          |   12 ++++++------
 _html.py          |    8 ++++----
 _http.py          |    4 ++--
 _mechanize.py     |    2 +-
 _msiecookiejar.py |    4 ++--
 _opener.py        |    2 +-
 _sgmllib_copy.py  |   28 ++++++++++++++--------------
 _urllib2_fork.py  |   14 +++++++-------
 9 files changed, 43 insertions(+), 43 deletions(-)

probably that's not even enough to make it work with Python 3.4.

Then I tried running the unit tests. First, they fail with Python 2.7 (2
errors). It's to be noted that the unit tests were not even run at build
time for the package. Then for Python 3, there's all sorts of errors
that needs to be fixed as well...

At this point, I gave-up with mechanize. But then, this makes me wonder:
can we continue to use wsgi-intercept if it depends on such a bad Python
module.

If we are to stick to an older version of wsgi-intercept (which I do not
recommend, for maintainability reasons), could someone help me to fix
the Python 3.4 issue I'm having with wsgi-intercept? Removing Python 3
support would be sad... :(

Your thoughts?

Cheers,

Thomas Goirand (zigo)



More information about the OpenStack-dev mailing list