Skip to content

RFC5322-like parsing failure #3

@user-none

Description

@user-none

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions