summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2019-11-02 01:28:22 -0400
committerSean Whitton <spwhitton@spwhitton.name>2019-11-02 08:44:19 -0700
commitd6dc4aaf0d465c3c267b9c8a663011b0b01fadcd (patch)
treebbdc6bee3ba3c74163c43765b52ec910f95e1997
parent8dd6783b9bf37d0e12b343da6105cd92a5ebef1d (diff)
downloadmailscripts-d6dc4aaf0d465c3c267b9c8a663011b0b01fadcd.tar.gz
email-print-mime-structure: add another FIXME about bytecounting
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
-rwxr-xr-xemail-print-mime-structure1
1 files changed, 1 insertions, 0 deletions
diff --git a/email-print-mime-structure b/email-print-mime-structure
index 98b35fe..c1476d2 100755
--- a/email-print-mime-structure
+++ b/email-print-mime-structure
@@ -61,6 +61,7 @@ class MimePrinter(object):
payload:Union[List[Message], str, bytes, None] = z.get_payload()
if not isinstance(payload, (str,bytes)):
raise TypeError(f'expected payload to be either str or bytes, got {type(payload)}')
+ # FIXME: it looks like we are counting chars here, not bytes:
nbytes = len(payload)
print(f'{prefix}{z.get_content_type()}{cset}{disposition}{fname} {nbytes:d} bytes')