[Python-checkins] r62713 - python/trunk/Lib/urllib2.py

georg.brandl python-checkins at python.org
Sun May 4 23:40:45 CEST 2008


Author: georg.brandl
Date: Sun May  4 23:40:44 2008
New Revision: 62713

Log:
#2695: Do case-insensitive check for algorithms.


Modified:
   python/trunk/Lib/urllib2.py

Modified: python/trunk/Lib/urllib2.py
==============================================================================
--- python/trunk/Lib/urllib2.py	(original)
+++ python/trunk/Lib/urllib2.py	Sun May  4 23:40:44 2008
@@ -976,6 +976,8 @@
         return base
 
     def get_algorithm_impls(self, algorithm):
+        # algorithm should be case-insensitive according to RFC2617
+        algorithm = algorithm.upper()
         # lambdas assume digest modules are imported at the top level
         if algorithm == 'MD5':
             H = lambda x: hashlib.md5(x).hexdigest()


More information about the Python-checkins mailing list