#428 closed defect (invalid)
email2trac crashes with Python error
Reported by: | anonymous | Owned by: | bas |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | email2trac | Version: | 2.8.4 |
Keywords: | Cc: |
Description
When running email2trac 2.12.2 on CentOS7 with Python 2.7.5 and the commandline:
email2trac -d -v < msg.txt
using the msg.txt distributed with the application, parsing crashes. python does a trace dump as follows:
2018-05-06 16:54:59,457 email2trac test: function inline_properties 2018-05-06 16:54:59,457 email2trac test: function unique_attachment_names() 2018-05-06 16:54:59,457 email2trac test: function get_body_text() 2018-05-06 16:54:59,459 email2trac test: Traceback (most recent call last):
2018-05-06 16:54:59,459 email2trac test: File "/usr/local/bin/email2trac", line 2922, in <module>
tktparser.parse(sys.stdin)
2018-05-06 16:54:59,459 email2trac test: File "/usr/local/bin/email2trac", line 1863, in parse
self.parse_subject_field(m, subject, spam_msg)
2018-05-06 16:54:59,459 email2trac test: File "/usr/local/bin/email2trac", line 2008, in parse_subject_field
self.new_ticket(m, subject, spam_msg)
2018-05-06 16:54:59,459 email2trac test: File "/usr/local/bin/email2trac", line 1340, in new_ticket
self.id = tkt.insert()
2018-05-06 16:54:59,459 email2trac test: File "/usr/lib64/python2.7/site-packages/trac/ticket/model.py", line 261, in insert
db_values = self._to_db_types(self.values)
2018-05-06 16:54:59,459 email2trac test: File "/usr/lib64/python2.7/site-packages/trac/ticket/model.py", line 405, in _to_db_types
values[field] = _datetime_to_db_str(value, is_custom_field)
2018-05-06 16:54:59,460 email2trac test: File "/usr/lib64/python2.7/site-packages/trac/ticket/model.py", line 63, in _datetime_to_db_str
ts = to_utimestamp(dt)
2018-05-06 16:54:59,460 email2trac test: File "/usr/lib64/python2.7/site-packages/trac/util/datefmt.py", line 193, in to_utimestamp
diff = dt - _epoc
2018-05-06 16:54:59,460 email2trac test: TypeError?: unsupported operand type(s) for -: 'unicode' and 'datetime.datetime'
2018-05-06 16:54:59,460 email2trac test: saving email to /tmp/test_DeEDc.email2trac 2018-05-06 16:54:59,461 email2trac test: function get_message_parts() 2018-05-06 16:54:59,461 email2trac test: Message part: Main-Type: multipart 2018-05-06 16:54:59,461 email2trac test: Message part: Content-Type: multipart/mixed 2018-05-06 16:54:59,461 email2trac test: Skipping multipart container 2018-05-06 16:54:59,461 email2trac test: Message part: Main-Type: text 2018-05-06 16:54:59,461 email2trac test: Message part: Content-Type: text/plain
Attachments (0)
Change History (2)
comment:1 Changed 6 years ago by anonymous
- Resolution set to invalid
- Status changed from new to closed
- Version set to 2.8.4
comment:2 Changed 6 years ago by anonymous
FYI a work around I found is that you can keep your date-based custom fields as long as you set them (blank value works) as inline properties in the body, e.g.:
@custom_date :
Problems occurred because of date-based custom fields. Once removed, parsing worked.