Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #22561 -- Measured email long lines on encoded content #7803

Closed
wants to merge 1 commit into from

Conversation

claudep
Copy link
Member

@claudep claudep commented Jan 6, 2017

Thanks Pavel Pokrovskiy for the report.

@@ -219,7 +219,9 @@ def __setitem__(self, name, val):

def set_payload(self, payload, charset=None):
if charset == 'utf-8':
has_long_lines = any(len(l) > RFC5322_EMAIL_LINE_LENGTH_LIMIT for l in payload.splitlines())
has_long_lines = any(
len(l.encode('utf-8')) > RFC5322_EMAIL_LINE_LENGTH_LIMIT for l in payload.splitlines()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for .... could go on the next line to balance things out

@@ -779,7 +779,8 @@ def test_send_long_lines(self):
Message body containing longer lines are converted to Quoted-Printable
to avoid having to insert newlines, which could be hairy to do properly.
"""
email = EmailMessage('Subject', "Comment ça va? " * 100, 'from@example.com', ['to@example.com'])
# The body length is < 998 (840) when unencoded, but > 998 when utf-8 encoded.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the comment fit on one line: (no comma needed since what comes after isn't an independent clause)
# Unencoded body length is < 998 (840) but > 998 when utf-8 encoded.

@@ -779,7 +779,8 @@ def test_send_long_lines(self):
Message body containing longer lines are converted to Quoted-Printable
to avoid having to insert newlines, which could be hairy to do properly.
"""
email = EmailMessage('Subject', "Comment ça va? " * 100, 'from@example.com', ['to@example.com'])
# The body length is < 998 (840) when unencoded, but > 998 when utf-8 encoded.
email = EmailMessage('Subject', "В южных морях " * 60, 'from@example.com', ['to@example.com'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use single quotes for consistency.

@timgraham
Copy link
Member

Should it be backported to 1.10?

@claudep
Copy link
Member Author

claudep commented Jan 6, 2017

I don't think it's a regression, neither a bug in a new feature. Just a better fixed bug...

Thanks Pavel Pokrovskiy for the report and Tim Graham for the review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants