------------------------------------------------------------
revno: 6645
committer: Barry Warsaw <[EMAIL PROTECTED]>
branch nick: py26
timestamp: Thu 2008-10-16 00:48:15 -0400
message:
Target Python 2.6. Make the test suite pass without deprecations.
modified:
.bzrignore
mailman/Utils.py
mailman/passwords.py
mailman/pipeline/scrubber.py
mailman/queue/__init__.py
mailman/tests/test_security_mgr.py
setup.py
=== modified file '.bzrignore'
--- a/.bzrignore 2008-04-26 05:39:14 +0000
+++ b/.bzrignore 2008-10-16 04:48:15 +0000
@@ -6,7 +6,7 @@
dist/
mailman.egg-info
misc/mailman
-setuptools_bzr-*.egg
+setuptools*
staging
TAGS
var/
=== modified file 'mailman/Utils.py'
--- a/mailman/Utils.py 2008-09-30 01:48:19 +0000
+++ b/mailman/Utils.py 2008-10-16 04:48:15 +0000
@@ -25,7 +25,6 @@
import os
import re
import cgi
-import sha
import time
import errno
import base64
=== modified file 'mailman/passwords.py'
--- a/mailman/passwords.py 2008-09-27 01:11:51 +0000
+++ b/mailman/passwords.py 2008-10-16 04:48:15 +0000
@@ -22,8 +22,8 @@
import os
import re
-import sha
import hmac
+import hashlib
from array import array
from base64 import urlsafe_b64decode as decode
@@ -93,12 +93,12 @@
@staticmethod
def make_secret(password):
- h = sha.new(password)
+ h = hashlib.sha1(password)
return encode(h.digest())
@staticmethod
def check_response(challenge, response):
- h = sha.new(response)
+ h = hashlib.sha1(response)
return challenge == encode(h.digest())
@@ -109,7 +109,7 @@
@staticmethod
def make_secret(password):
salt = os.urandom(SALT_LENGTH)
- h = sha.new(password)
+ h = hashlib.sha1(password)
h.update(salt)
return encode(h.digest() + salt)
@@ -119,7 +119,7 @@
challenge_bytes = decode(challenge)
digest = challenge_bytes[:20]
salt = challenge_bytes[20:]
- h = sha.new(response)
+ h = hashlib.sha1(response)
h.update(salt)
return digest == h.digest()
@@ -139,7 +139,7 @@
and a constant block counter appended to the salt in the initial hmac
update.
"""
- h = hmac.new(password, None, sha)
+ h = hmac.new(password, None, hashlib.sha1)
prf = h.copy()
prf.update(salt + '\x00\x00\x00\x01')
T = U = array('l', prf.digest())
=== modified file 'mailman/pipeline/scrubber.py'
--- a/mailman/pipeline/scrubber.py 2008-09-29 13:19:52 +0000
+++ b/mailman/pipeline/scrubber.py 2008-10-16 04:48:15 +0000
@@ -25,9 +25,9 @@
import os
import re
-import sha
import time
import errno
+import hashlib
import logging
import binascii
@@ -140,7 +140,7 @@
if msgid is None:
msgid = msg['Message-ID'] = make_msgid()
# We assume that the message id actually /is/ unique!
- digest = sha.new(msgid).hexdigest()
+ digest = hashlib.sha1(msgid).hexdigest()
return os.path.join('attachments', datedir, digest[:4] + digest[-4:])
=== modified file 'mailman/queue/__init__.py'
--- a/mailman/queue/__init__.py 2008-09-30 01:48:19 +0000
+++ b/mailman/queue/__init__.py 2008-10-16 04:48:15 +0000
@@ -34,12 +34,12 @@
import os
-import sha
import time
import email
import errno
import pickle
import cPickle
+import hashlib
import logging
import marshal
import traceback
@@ -53,7 +53,7 @@
from mailman.configuration import config
from mailman.interfaces import IRunner, ISwitchboard
-# 20 bytes of all bits set, maximum sha.digest() value
+# 20 bytes of all bits set, maximum hashlib.sha.digest() value
shamax = 0xffffffffffffffffffffffffffffffffffffffffL
# Small increment to add to time in case two entries have the same time. This
@@ -126,7 +126,7 @@
# time for this message (i.e. when it first showed up on this system)
# and the sha hex digest.
rcvtime = data.setdefault('received_time', now)
- filebase = repr(rcvtime) + '+' + sha.new(hashfood).hexdigest()
+ filebase = repr(rcvtime) + '+' + hashlib.sha1(hashfood).hexdigest()
filename = os.path.join(self._whichq, filebase + '.pck')
tmpfile = filename + '.tmp'
# Always add the metadata schema version number
=== modified file 'mailman/tests/test_security_mgr.py'
--- a/mailman/tests/test_security_mgr.py 2008-09-27 01:11:51 +0000
+++ b/mailman/tests/test_security_mgr.py 2008-10-16 04:48:15 +0000
@@ -18,8 +18,6 @@
"""Unit tests for the SecurityManager module."""
import os
-import md5
-import sha
import errno
import Cookie
import unittest
=== modified file 'setup.py'
--- a/setup.py 2008-09-29 13:19:52 +0000
+++ b/setup.py 2008-10-16 04:48:15 +0000
@@ -27,8 +27,8 @@
-if sys.hexversion < 0x20500f0:
- print 'Mailman requires at least Python 2.5'
+if sys.hexversion < 0x20600f0:
+ print 'Mailman requires at least Python 2.6'
sys.exit(1)
--
Primary development focus
https://code.launchpad.net/~mailman-coders/mailman/3.0
You are receiving this branch notification because you are subscribed to it.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org