Mercurial > p > roundup > code
diff roundup/scripts/roundup_mailgw.py @ 5432:fec18298ae02
Python 3 preparation: HTTP headers handling in roundup_server.py.
HTTP headers are handled differently in Python 3 (where they use
email.message.Message) compared to Python 2 (where they use
mimetools.Message). In some places the code needs to check which
version of the interface is available. For the common case of getting
a single header, ".get" is available in both versions, and is an alias
of ".getheader" in Python 2. (Note that the Python 3 semantics of
".get" are slightly different from those in Python 2 if there is more
than one of a given header - it returns an arbitrary one, when in
Python 2 it's specified to return the last one. Hopefully the places
using this interface rather than explicitly allowing for multiple
headers with the same name are OK with that and it shouldn't actually
occur with well-behaved clients.)
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 10:41:32 +0000 |
| parents | 55f09ca366c4 |
| children | c7a9f9c1801d |
