racker/falcon — pull request #327 by kgriffs (2014-10-02 21:48:26+00:00)
Title: doc: Quickstart example doesn't work on Py3K due to json.load

json.load in Python 3 no longer accepts an encoding parameter (or bytes),
so the example was reworked to read the bytes, decode them, and then parse
as JSON in three separate steps.

Unfortunately, doing something like this was found not to work:

json.load(io.TextIOWrapper(req.stream, 'utf-8'))

The reason is that it requires req.stream to implement io.IOBase but at
least in the case of uWSGI's Body class that is used for wsgi.input, the
'readable' attribute is not implemented. Falcon could patch wsgi.input to
provide this, but that would add an extra layer of abstraction that may
have performance implications (TBD).

Closes #275