'mechanize' doesn't work with Python 2.6 'urllib2' due to missing 'timeout' attribute

Bug #280334 reported by Sidnei da Silva on 2008-10-08
2
Affects Status Importance Assigned to Milestone
Python
New
Unknown
Zope 2
Undecided
Unassigned
Zope 3
Undecided
Unassigned
zope.testbrowser
Medium
Tres Seaver

Bug Description

'urllib2' has introduced a configurable 'timeout' setting by assigning
to the 'timeout' attribute of the urllib2.Request object. However the
implementation is flawed:

- the 'timeout' attribute is set in OpenerDirector.open() and nowhere else

- if someone overrides OpenerDirector.open() (btw: mechanize does
  this), then the 'timeout' attribute will never be set, breaking
  other parts of the code which require the 'timeout' attribute to be
  present.

A simple workaround for this would be to:

a) define the 'timeout' attribute as socket._GLOBAL_DEFAULT_TIMEOUT in mechanize._request.Request when socket._GLOBAL_DEFAULT_TIMEOUT is available

Changed in python:
status: Unknown → New
Tres Seaver (tseaver) on 2010-04-15
Changed in zope2:
status: New → Won't Fix
Changed in zope3:
status: New → Won't Fix
Changed in python:
status: New → Unknown
Tres Seaver (tseaver) wrote :

This bug should be fixed by the next release from the trunk of zope.testbrowser, as the trunk now depends on mechanize 0.2.0, now fully Python 2.6 compatible.

Changed in zope.testbrowser:
assignee: nobody → Tres Seaver (tseaver)
importance: Undecided → Medium
status: New → Fix Committed
Tres Seaver (tseaver) wrote :

Fix released with zope.testbrowser 3.9.0:

 http://pypi.python.org/pypi/zope.testbrowser/3.9.0

Changed in zope.testbrowser:
status: Fix Committed → Fix Released
Changed in python:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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