~paulegan/flufl.bounce/caiwireless-bug-917720

« back to all changes in this revision

Viewing changes to flufl/bounce/_detectors/simplematch.py

  • Committer: Barry Warsaw
  • Date: 2012-01-04 16:39:36 UTC
  • Revision ID: barry@python.org-20120104163936-qrrd7ipqrprpxwvp
 * Port to Python 3 is mostly complete, however the test suite current fails
   because of <https://bugs.launchpad.net/zope.interface/+bug/911851>.  Once
   that bug is fixed in `zope.interface`, `flufl.bounce` should be Python 3.2
   compatible without the need for `2to3`.
 * All returned addresses are bytes objects in Python 3 and 8-bit strings in
   Python 2 (no change there).

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    # email.quoprimime.header_decode() because that also turns underscores
51
51
    # into spaces, which is not good for us.  Instead we'll use the
52
52
    # undocumented email.quoprimime.unquote().
53
 
    return re.sub('=[a-fA-F0-9]{2}', _unquote_match, address).strip()
 
53
    #
 
54
    # For compatibility with Python 3, the API requires byte addresses.
 
55
    unquoted = re.sub('=[a-fA-F0-9]{2}', _unquote_match, address)
 
56
    return unquoted.encode('us-ascii').strip()
54
57
 
55
58
 
56
59