z4r/python-rtkit — Issue #3: RFC5322-like parsing failure
Author: user-none
Created: 2012-01-11 22:29:09+00:00
State: open

The issue is In resource.py function _build.

Some of the ticket returned by RT have two dashes in the subject. When splitting based on -- these are being categorized as as new sections. This can also lead to exceptions being thrown in build_section when the area after -- has a space but logic_lines is empty.

E.G.

123: Data returned by RT -- has two dashes...

The solution I'm using is use a re to create the split. I've changed the last line in the file to:

return [build_section(b) for b in re.split('(?mu)^\s*--', body)]

This ensures that the --'s start the line with white space removed. multi-line is required to have ^ match at the beginning of the line but u probably isn't necessary.