[PATCH 0/6] Improvements to message parsing

Daniel Axtens dja at axtens.net
Fri Sep 23 10:06:11 AEST 2016


As described in my previous writeup, this cleaned up series includes:
 - some fixes to make testing easier by passing around command-line options
 - fixes for headers with invalid characters
 - A modified version of Stephen's parsemail managment command migration
 - more tests

I suspect the mailing list might drop patch 3 as it contains 2 mbox
files, so I'll also send a pull request with the details on how to
pull it from git.

Daniel Axtens (6):
  parsemail.sh: make testing easier
  parsemail-batch.sh: pass command-line options to parsemail
  parser: parse headers containing invalid characters
  parser tests: test parsing of interesting characters
  parsemail: Convert to a management command
  parsemail tests: add test for mail with utf-8

 patchwork/bin/parsemail-batch.sh                   |   8 +-
 patchwork/bin/parsemail.py                         | 114 ---------------------
 patchwork/bin/parsemail.sh                         |  17 ++-
 patchwork/management/commands/parsemail.py         |  84 +++++++++++++++
 patchwork/parser.py                                |  77 ++++++++++++--
 patchwork/settings/base.py                         |  60 ++++++++++-
 patchwork/tests/__init__.py                        |  23 +++++
 patchwork/tests/mail/0012-invalid-header-char.mbox |  72 +++++++++++++
 patchwork/tests/mail/0013-with-utf8-body.mbox      |  46 +++++++++
 patchwork/tests/test_management.py                 | 112 ++++++++++++++++++++
 patchwork/tests/test_parser.py                     |  29 +++++-
 patchwork/tests/utils.py                           |   2 +-
 12 files changed, 503 insertions(+), 141 deletions(-)
 delete mode 100755 patchwork/bin/parsemail.py
 create mode 100644 patchwork/management/commands/parsemail.py
 create mode 100644 patchwork/tests/mail/0012-invalid-header-char.mbox
 create mode 100644 patchwork/tests/mail/0013-with-utf8-body.mbox
 create mode 100644 patchwork/tests/test_management.py

-- 
2.7.4



More information about the Patchwork mailing list