New submission from Tom Lynn <[EMAIL PROTECTED]>:

urllib2.py:424 (Py 2.4) or urllib2.py:443 (Py 2.5) in build_opener()::

        skip = []
        for klass in default_classes:
            for check in handlers:
                if inspect.isclass(check):
                    if issubclass(check, klass):
                        skip.append(klass)
                elif isinstance(check, klass):
                    skip.append(klass)
        for klass in skip:
           default_classes.remove(klass)

This can cause klass to be appended to skip multiple times,
which then causes an exception in the final line quoted above.

skip should be a set (and append changed to add), or "if klass
not in skip:" should be added before each "skip.append(klass)".

----------
components: Library (Lib)
messages: 65683
nosy: tlynn
severity: normal
status: open
title: urllib2 build_opener() fails if two handlers use the same default base 
class
type: behavior
versions: Python 2.4, Python 2.5

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2670>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to