Skip to content

[2.7] WIP: bpo-11492: rewrite email header folding algorithm - #10378

Closed
vstinner wants to merge 1 commit into
python:2.7from
vstinner:header_encode
Closed

vstinner wants to merge 1 commit into
python:2.7from
vstinner:header_encode

Conversation

@vstinner

@vstinner vstinner commented Nov 7, 2018

Copy link
Copy Markdown
Member

Less code, more passing tests.

https://bugs.python.org/issue11492

@vstinner vstinner changed the title WIP: bpo-11492: rewrite email header folding algorithm [2.7] WIP: bpo-11492: rewrite email header folding algorithm Nov 7, 2018
@vstinner

vstinner commented Nov 7, 2018

Copy link
Copy Markdown
Member Author

I mostly wrote this PR to show that backporting the folding algorithm from Python 3 to Python 2 is a very bad idea: it breaks almost all test_email tests... It changes all email headers in many different ways.

Comment thread Lib/email/charset.py
"""
# See which encoding we should use.
codec = self.output_codec or 'us-ascii'
_encode = lambda a, b: self.convert(a)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is my hack, it looks wrong :-)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

test_email_codecs fails on this lambda function :-)

@vstinner vstinner closed this Nov 8, 2018
@vstinner
vstinner deleted the header_encode branch November 8, 2018 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants