[issue34277] EmailPolicy not followed

2020-07-31 Thread Bryce Drennan
Change by Bryce Drennan : Removed file: https://bugs.python.org/file47720/test_header_folding.py ___ Python tracker ___ ___

[issue34277] EmailPolicy not followed

2018-07-30 Thread Bryce Drennan
Bryce Drennan added the comment: As far as I can tell in my manual tests with gmail, extra whitespace is fine. The addition of `=?utf-8?q?` is what trips both gmail and the python dkim library up. I agree that the paths you propose are viable. For now my email projects will be pinned to

[issue34277] EmailPolicy not followed

2018-07-30 Thread R. David Murray
R. David Murray added the comment: Well, it can't fold them and have them fit in the 78 character limit without adding whitespace that isn't in the original headers (unless there's a more subtle bug :) The email package has the possibility of having special behavior based on the name of

[issue34277] EmailPolicy not followed

2018-07-30 Thread Bryce Drennan
Bryce Drennan added the comment: That makes sense. Apologies for my misreading. Thanks for taking time to explain that. I think there is still something strange here since it's unnecessarily using encoded words when it could just "fold" without them. My tests with gmail show that it

[issue34277] EmailPolicy not followed

2018-07-30 Thread R. David Murray
R. David Murray added the comment: You are indeed misunderstanding. The docs say: If False, follow RFC 5322, supporting non-ASCII characters in headers by encoding them as “encoded words”. If True, follow RFC 6532 and use utf-8 encoding for headers. Messages formatted in this way may be

[issue34277] EmailPolicy not followed

2018-07-30 Thread Bryce Drennan
Bryce Drennan added the comment: Yes, utf8 is set to false. Despite that, the dkim-signature header, which contains no unicode characters, is getting filled with ?utf-8?q? values. My reading of the documentation of the utf8 flag is that headers should not be encoded like this if its set to

[issue34277] EmailPolicy not followed

2018-07-30 Thread R. David Murray
R. David Murray added the comment: I don't see you asserting utf8=True in your example, so I don't see what it has to do with the utf8 flag, since that is False by default. Maybe you are running up against the default value of refold_header, which is 'long'? --

[issue34277] EmailPolicy not followed

2018-07-29 Thread Bryce Drennan
New submission from Bryce Drennan : Starting in 3.6.4, the header flattening ignores the EmailyPolicy.utf8 attribute if a header is longer than maxlen. I believe this was introduced in https://github.com/python/cpython/pull/4693. Specifically this part: