New submission from david reid <[EMAIL PROTECTED]>:

Small change to allow get_algorithm_impls to correctly detect when lower
case algorithm strings are passed. I recently ran into a server that
sent 'md5' and so this function failed without this small change.

    def get_algorithm_impls(self, algorithm):
        # lambdas assume digest modules are imported at the top level
        if algorithm.lower() == 'md5':
            H = lambda x: hashlib.md5(x).hexdigest()
        elif algorithm.lower() == 'sha':
            H = lambda x: hashlib.sha1(x).hexdigest()
        ...

----------
components: Library (Lib)
messages: 65836
nosy: zathras
severity: normal
status: open
title: Ignore case when checking algorithm in urllib2
type: behavior
versions: Python 2.5

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

Reply via email to