Created on 2016-12-23 14:16 by bpoaugust, last changed 2022-04-11 14:58 by admin.
Files |
|
|
|
File name |
Uploaded |
Description |
Edit |
mboxo_patch.py |
bpoaugust,2016-12-24 01:54 |
|
|
Messages (5) |
|
|
msg283879 - (view) |
Author: (bpoaugust) |
Date: 2016-12-23 14:16 |
The email package implements mboxo From_ mangling on output by default. However there is no provision to unmangle >From_ on input. This means that it's not possible to import mboxo files correctly. |
|
|
msg283882 - (view) |
Author: (bpoaugust) |
Date: 2016-12-23 14:27 |
Is there any way to override the current behaviour? |
|
|
msg283883 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2016-12-23 14:43 |
Not easily. Making the feedparser more pluggable is on my wish list, but at this point someone would have to fund me for work on the email package before I'd be able to even clear the backlog to think about it :) I'd say accepting this as a new feature is a no-brainer, if you want to work on a patch. Make enabling it a Policy option that defaults to the current behavior. |
|
|
msg283914 - (view) |
Author: (bpoaugust) |
Date: 2016-12-24 01:54 |
Attached please find patch which works for me. To use it independently of email, do something like: messages = mailbox.mbox(filename, MboxoFactory) where: class MboxoFactory(mailbox.mboxMessage): def __init__(self, message=None): super().__init__(message=MboxoReader(message)) HTH |
|
|
msg284500 - (view) |
Author: (bpoaugust) |
Date: 2017-01-02 20:42 |
The patch can be simplified by just looking for b'\n' in the last 6 chars, and caching from b'\n' if found. This would mean more file seeking in exchange for less buffer matching. |
|
|
History |
|
|
|
Date |
User |
Action |
Args |
2022-04-11 14:58:41 |
admin |
set |
github: 73239 |
2017-01-03 12:21:51 |
vstinner |
set |
title: Implement >From_ decoding on input from mbox -> mailbox: Implement >From_ decoding on input from mbox |
2017-01-02 20:42:43 |
bpoaugust |
set |
messages: + |
2016-12-29 20:49:40 |
bpoaugust |
set |
versions: + Python 3.5, - Python 3.7 |
2016-12-24 01:54:40 |
bpoaugust |
set |
files: + mboxo_patch.pymessages: + |
2016-12-23 14:43:12 |
r.david.murray |
set |
type: behavior -> enhancementstage: needs patchmessages: + versions: + Python 3.7 |
2016-12-23 14:27:34 |
bpoaugust |
set |
messages: + |
2016-12-23 14:16:48 |
bpoaugust |
create |
|