Modify ↓
Opened 18 years ago
Closed 18 years ago
#4835 closed enhancement (invalid)
fix for bad contrib/emailfilter.py encoding behaviour
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
when submitting tickets via e-mail using the emailfilter.py, it caused trac to crash. the reason was that it inserted non-utf8 content into the database. the attached diff should fix that:
@@ -53,7 +53,10 @@ tkt['summary'] = msg['subject'] for part in msg.walk(): if part.get_content_type() == 'text/plain': - tkt['description'] = part.get_payload(decode=1).strip() + ch = part.get_content_charset() + payload = part.get_payload(decode=True).strip() + plain = unicode(payload, ch).encode('utf-8') + tkt['description'] = plain if tkt.values.get('description'): tkt.insert()
Attachments (0)
Change History (3)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Description: | modified (diff) |
---|
This web site is for the development of Trac itself.
Please report any plugin/extension issue to their respective author: th:wiki:EmailtoTracScript
Thanks in advance.
comment:3 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
sorry, we can use WikiFormatting :)