You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ponymail.apache.org by sebbASF <gi...@git.apache.org> on 2016/11/16 10:06:59 UTC
[GitHub] incubator-ponymail issue #244: Bug: archiver.py strange handling of multiple...
GitHub user sebbASF opened an issue:
https://github.com/apache/incubator-ponymail/issues/244
Bug: archiver.py strange handling of multiple charsets in msgbody() function
The msgbody function contains the following code:
```
for charset in pm_charsets(msg):
try:
body = body.decode(charset) if type(body) is bytes else body
except:
body = body.decode('utf-8', errors='replace') if type(body) is bytes else body
```
AFAICT this can only ever apply the first charset, because if that fails, it will use utf-8, and the type will no longer be bytes.
If the intention was to try to apply charsets until one works, then the code is broken.
It's also not clear why it is useful to try all the charsets in the message rather that the one that actually applies to the part in question.
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-ponymail issue #244: Bug: archiver.py strange handling of multiple...
Posted by sebbASF <gi...@git.apache.org>.
Github user sebbASF commented on the issue:
https://github.com/apache/incubator-ponymail/issues/244
It's also not clear if the code is ever invoked: can the body still be bytes at that point?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---