[Twisted-web] [BACKWARDS INCOMPATIBLE] Moving Twisted to PEP-3333

Amber "Hawkie" Brown hawkowl at atleastfornow.net
Mon Dec 21 23:27:23 MST 2015


Hi everyone!

We've been attempting to port twisted.web.wsgi to Python 3, as of recent. The existence of PEP-3333 makes this easier, but due to our backwards compatibility policy, implementing stricter checks to make sure t.w.wsgi-using applications are actually PEP-3333 may be a change which cannot be easily done.

The patch we have currently, which is based on work by jMyles (of Hendrix), tirelessly worked on allennap (of Canonical MAAS), and sheparded along by the wonderful Adi (our other Twisted Fellow), is in very good shape, bringing Twisted's WSGI support to be compliant with PEP-3333. PEP-3333 is much stricter on bytes/Unicode, and the patch introduces some further type checking that the original PEP-333 describes as a must, even though we did not check this before.

This branch cannot currently be merged because of backwards compatibility issues -- the spirit of our Compatibility Policy is that 'apps keep working', and sufficiently Unicode unclean WSGI applications may break due to it, even though PEP-333 is very explicit in saying that "HTTP does not directly support Unicode, and neither does this interface".

So, I am looking to get a compat exception for this -- WSGI is very explicit in its types, and any misbehaving applications are violating the specification grossly enough for there to possibly not need a compat exception -- but going through this way may catch the attention of anyone with a potentially misbehaving application and fix it before Twisted 16.0, when I expect this will be merged.

The ticket is https://twistedmatrix.com/trac/ticket/7993, and the branch you should test against is linked at the top. The compatibility policy will allow a week before we move to merge the ticket, although we may have some changes to the branch to make warnings turn into errors, if we are breaking backwards compat, so please ensure no exceptions *or warnings* are produced by your code.

Thanks,

- Amber
Twisted Fellow, RM, Python 3 Overlord
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://twistedmatrix.com/pipermail/twisted-web/attachments/20151222/e631024e/attachment.pgp>


More information about the Twisted-web mailing list