Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core
Commits: 9132d1f3 by Mark Sapiro at 2020-12-03T21:17:35-08:00 Fix scrubber to not reference non-existent payload. - - - - - 9176bf6e by Mark Sapiro at 2020-12-04T05:59:41+00:00 Merge branch 'scrub' into 'master' Fix scrubber to not reference non-existent payload. See merge request mailman/mailman!741 - - - - - 2 changed files: - src/mailman/utilities/scrubber.py - src/mailman/utilities/tests/test_scrubber.py Changes: ===================================== src/mailman/utilities/scrubber.py ===================================== @@ -43,7 +43,7 @@ def scrub(msg): # Unknown or empty charset. payload = payload.decode('us-ascii', 'replace') else: - size = len(payload) # noqa: F841 + size = len(part.get_payload(decode=True)) # noqa: F841 desc = part.get('content-description', # noqa: F841 _('not available')) filename = part.get_filename(_('not available')) # noqa: F841 ===================================== src/mailman/utilities/tests/test_scrubber.py ===================================== @@ -56,7 +56,7 @@ This is the first text/plain part A message part incompatible with plain text digests has been removed ... Name: not available Type: text/html -Size: 34 bytes +Size: 27 bytes Desc: not available -------------- next part -------------- Plain text with \\u201cfancy quotes\\u201d from embedded message. @@ -64,12 +64,12 @@ Plain text with \\u201cfancy quotes\\u201d from embedded message. A message part incompatible with plain text digests has been removed ... Name: not available Type: text/html -Size: 64 bytes +Size: 58 bytes Desc: not available -------------- next part -------------- A message part incompatible with plain text digests has been removed ... Name: Image Type: image/jpeg -Size: 144 bytes +Size: 16 bytes Desc: A JPEG image """) View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/32c9dc70d0a6be08739619f5709140b0188494b8...9176bf6ee3fa8c707e8a60aeca495e799c07e216 -- View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/32c9dc70d0a6be08739619f5709140b0188494b8...9176bf6ee3fa8c707e8a60aeca495e799c07e216 You're receiving this email because of your account on gitlab.com.
_______________________________________________ Mailman-checkins mailing list -- mailman-checkins@python.org To unsubscribe send an email to mailman-checkins-le...@python.org https://mail.python.org/mailman3/lists/mailman-checkins.python.org/ Member address: arch...@jab.org