Nicolas Dumazet nicd...@gmail.com added the comment:
Hello folks.
(stumbling on this bug with Python2.7 release, noting that a few Mercurial
tests broke with 2.7)
I have no problem whatsoever with the fix itself (you know emails better than
me), but you broke backwards compatibility for
Chris Withers ch...@simplistix.co.uk added the comment:
Maybe an old-fashioned monkey-patch would be the way to go?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1974
___
Nicolas Dumazet nicd...@gmail.com added the comment:
Sure, where was my head.
So, a simple patch like this one:
_oldheaderinit = email.Header.Header.__init__
def _unifiedheaderinit(self, *args, **kw):
# override continuation_ws
kw['continuation_ws'] = ' '
_oldheaderinit(self,
Chris Withers ch...@simplistix.co.uk added the comment:
It's probably worth noting that changing:
from email.mime.text import MIMEText
m = MIMEText('foo')
m['subject']='something long'
...to:
from email.header import Header
m = MIMEText('foo')
m['subject']=Header('something long')
...will
Chris Withers ch...@simplistix.co.uk added the comment:
Barry and I talked about this and he's is now working on it.
We're literally going to remove the \t folding substitution and have it
do the default space folding substitution instead.
--
resolution: - accepted
versions: +Python
Barry A. Warsaw ba...@python.org added the comment:
So astoundingly, this change has deep implications. The upshot is that
it's difficult to fix this so that headers look nice for e.g. Subject
headers, but so that splitting and wrapping work as expected for e.g.
machine readability of Received
Changes by Martin von Gagern martin.vgag...@gmx.net:
--
nosy: +gagern
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1974
___
___
Python-bugs-list
Chris Withers [EMAIL PROTECTED] added the comment:
Ori,
I do agree with both you and Barry but is there any chance someone could
make the one-character change to make the /t a space so we can stop
seeing weirdness in common mail clients?
Perhaps a separate issue could be raised to refactor
Ori Avtalion [EMAIL PROTECTED] added the comment:
I think there's been a little misinterpretation of the standard in the
comments above.
It's important to note that RFC 2822 basically defines folding as
adding a CRLF before an existing whitespace in the original message.
See
Barry A. Warsaw [EMAIL PROTECTED] added the comment:
I'm pretty convinced that this stuff is broken and needs serious
attention. Unfortunately, I won't have time to address the email
package before 2.6 and 3.0 get released. My current work lives at
bzr+ssh://[EMAIL
Chris Withers [EMAIL PROTECTED] added the comment:
Again, in total agreement with Andi *EXCEPT*:
Please use ' ' instead of '\t' for the continuation character.
It's the \t that gets mis-rendered by Outlook and Thunderbird (at the
very least!) and since ' ' is also valid according to the RFC,
Andi Albrecht [EMAIL PROTECTED] added the comment:
FWIW, I've uploaded a patch to codereview:
http://codereview.appspot.com/2407
It uses a space character as Chris suggested.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1974
Chris Withers [EMAIL PROTECTED] added the comment:
Andi, I'm in total agreement with you :-)
(so if this bug could get fixed, both issues could get closed)
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1974
Steve Baker [EMAIL PROTECTED] added the comment:
I'm also hitting this problem. I'm including a demo script. The minimal
condition for me to reproduce this bug is that the subject contain at
least 76 characters of any kind, followed by a space, followed by at
least 3 characters of any kind.
Changes by Steve Baker [EMAIL PROTECTED]:
Added file: http://bugs.python.org/file10419/test.py
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1974
__
___
Python-bugs-list
Changes by Steve Baker [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10418/test
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1974
__
___
Python-bugs-list
Changes by Guido van Rossum:
--
assignee: - barry
nosy: +barry
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1974
__
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Chris Withers:
Somewhere in email.MIMEText.MIMEText.as_string (I'm not sure where) long
subject headers are folded using a newline followed by a tab:
from email.MIMEText import MIMEText
m = MIMEText('foo')
m['Subject']='AA '*40
m.as_string()
'Content-Type: text/plain;
18 matches
Mail list logo