diff options
| author | Barry Warsaw | 2014-12-08 21:35:41 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2014-12-08 21:35:41 -0500 |
| commit | 0b3b801e85d858a6fde47254d27985386d753762 (patch) | |
| tree | 3b09615a8416c3921503e6c611eab8ec56f2a449 /src | |
| parent | 6bcdeb8b7cf2e9b64955838bc89512ee7b6bb30c (diff) | |
| download | mailman-0b3b801e85d858a6fde47254d27985386d753762.tar.gz mailman-0b3b801e85d858a6fde47254d27985386d753762.tar.zst mailman-0b3b801e85d858a6fde47254d27985386d753762.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/rules/approved.py | 2 | ||||
| -rw-r--r-- | src/mailman/rules/tests/test_approved.py | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mailman/rules/approved.py b/src/mailman/rules/approved.py index 2839ffef4..c5d099001 100644 --- a/src/mailman/rules/approved.py +++ b/src/mailman/rules/approved.py @@ -112,7 +112,7 @@ class Approved: # may not work with rtf or whatever else is possible. pattern = header + ':(\s| )*' + re.escape(password) for part in typed_subpart_iterator(msg, 'text'): - payload = part.get_payload(decode=True) + payload = part.get_payload() if payload is not None: if re.search(pattern, payload): reset_payload(part, re.sub(pattern, '', payload)) diff --git a/src/mailman/rules/tests/test_approved.py b/src/mailman/rules/tests/test_approved.py index e7f122410..ec8e861af 100644 --- a/src/mailman/rules/tests/test_approved.py +++ b/src/mailman/rules/tests/test_approved.py @@ -433,7 +433,7 @@ class TestPasswordHashMigration(unittest.TestCase): # hash is chosen after the original password is set. As long as the # old password still validates, the migration happens automatically. self._mlist.moderator_password = config.password_context.encrypt( - b'super secret') + 'super secret') self._rule = approved.Approved() self._msg = mfs("""\ From: anne@example.com @@ -450,7 +450,7 @@ A message body. # hashing algorithm. When the old password is validated, it will be # automatically migrated to the new hash. self.assertEqual(self._mlist.moderator_password, - b'{plaintext}super secret') + '{plaintext}super secret') config_file = os.path.join(config.VAR_DIR, 'passlib.config') # XXX passlib seems to choose the default hashing scheme even if it is # deprecated. The default scheme is either specified explicitly, or @@ -466,14 +466,14 @@ deprecated = roundup_plaintext self._msg['Approved'] = 'super secret' result = self._rule.check(self._mlist, self._msg, {}) self.assertTrue(result) - self.assertEqual(self._mlist.moderator_password, b'super secret') + self.assertEqual(self._mlist.moderator_password, 'super secret') def test_invalid_password_does_not_migrate(self): # Now that the moderator password is set, change the default password # hashing algorithm. When the old password is invalid, it will not be # automatically migrated to the new hash. self.assertEqual(self._mlist.moderator_password, - b'{plaintext}super secret') + '{plaintext}super secret') config_file = os.path.join(config.VAR_DIR, 'passlib.config') # XXX passlib seems to choose the default hashing scheme even if it is # deprecated. The default scheme is either specified explicitly, or @@ -490,4 +490,4 @@ deprecated = roundup_plaintext result = self._rule.check(self._mlist, self._msg, {}) self.assertFalse(result) self.assertEqual(self._mlist.moderator_password, - b'{plaintext}super secret') + '{plaintext}super secret') |
