Message6091
The next nine patches get to the point where, while demo.py (with
mailgw.py hacked up) does not successfully serve a login page running
under Python 3, the resulting exception tracebacks at least get to the
browser rather than having a second exception occur during the handling
of the first because of Python 3 issues in the exception handling code.
56. Python 3 preparation: make fallback SysCallError an actual exception
class.
The code defines a fallback version of SysCallError when import of
OpenSSL.SSL. But in Python 3, defining it as None and then using in
"except" statements results in:
TypeError: catching classes that do not inherit from BaseException is
not allowed
57. Python 3 preparation: use bytes in _gen_nonce.
58. Python 3 preparation: write bytes to socket in roundup_server.py.
59. 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.)
60. Python 3 preparation: avoid string.split().
61. Python 3 preparation: avoid string.join().
62. Python 3 preparation: avoid string.translate() and string.maketrans().
63. Python 3 preparation: update tokenize use in cgitb.py.
Note that the same interface that has changed incompatibly is also used
in tools/pygettext.py. That file also needs fixing, but this patch does
*not* attempt such a fix.
64. Python 3 preparation: send bytes to socket in cgi/client.py. |
|
Date |
User |
Action |
Args |
2018-06-20 21:28:17 | joseph_myers | set | messageid: <1529530097.21.0.56676864532.issue2550960@psf.upfronthosting.co.za> |
2018-06-20 21:28:17 | joseph_myers | set | recipients:
+ joseph_myers, ber, rouilj |
2018-06-20 21:28:17 | joseph_myers | link | issue2550960 messages |
2018-06-20 21:28:16 | joseph_myers | create | |
|