title: Overriding Python Mechanize.Browser.open() method
body: <p>The following code:</p>
  
  <pre><code>#!/usr/bin/env python                                                                                                                                       
  
  import mechanize
  
  class MechanizeSubclass(mechanize.Browser):
      def __init__(self,
                   factory=None,
                   history=None,
                   request_class=None,
                  ):
          mechanize.Browser.__init__(self, factory, history, request_class)
  
      def open(self, url, data=None,
               timeout=mechanize._sockettimeout._GLOBAL_DEFAULT_TIMEOUT):
          mechanize.Browser.open(self, url, data, timeout=timeout)
  
  subclass = MechanizeSubclass()
  subclass.open('https://uncjobs.northcarolina.edu/applicants/jsp/shared/Welcome_css.jsp')
  print subclass.response().read()
  </code></pre>
  
  <p>generates the error </p>
  
  <pre><code>mechanize._response.httperror_seek_wrapper: HTTP Error 302: Moved Temporarily
  </code></pre>
  
  <p>I looked at the mechanize code and the Browser.open() method is defined as:</p>
  
  <pre><code>    def open(self, url, data=None,
           timeout=_sockettimeout._GLOBAL_DEFAULT_TIMEOUT):
      return self._mech_open(url, data, timeout=timeout)
  </code></pre>
  
  <p>and if I change the open() method in my subclass to match this:</p>
  
  <pre><code>class MechanizeSubclass(mechanize.Browser):
      ...
      def open(self, url, data=None,
           timeout=mechanize._sockettimeout._GLOBAL_DEFAULT_TIMEOUT):
          return self._mech_open(url, data, timeout=timeout)
  </code></pre>
  
  <p>then it works fine. But I still don't really understand why the first definition using mechanize.Browser.open(self, url, data, timeout=timeout) doesn't work. Shouldn't they be equivalent? This is with python 2.6 with mechanize 0.2.5.</p>