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

Bug #280334 reported by Sidnei da Silva
2
Affects Status Importance Assigned to Milestone
Python
New
Unknown
Zope 2
Won't Fix
Undecided
Unassigned
Zope 3
Won't Fix
Undecided
Unassigned
zope.testbrowser
Fix Released
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)
Changed in zope2:
status: New → Won't Fix
Changed in zope3:
status: New → Won't Fix
Changed in python:
status: New → Unknown
Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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