twilio/flask-restful — pull request #159 by singingwolfboy (2013-11-24 23:55:19+00:00)
Title: Avoid unicode LookupError

`six.text_type` is `unicode` on Python 2 and `str` on Python 3. Both of these
functions accept multiple parameters: the second is the `encoding` parameter.
According to the documentation: "The encoding parameter is a string giving the
name of an encoding; if the encoding is not known, `LookupError` is raised."
Because `LookupError` does not inherit from `TypeError`, it is not caught by
the try/catch blocks, and can result in Flask-Restful returning a 400 status
code response.

This commit changes the default type to a wrapper around `six.text_type` that
only takes one parameter. This way, an encoding will never be specified, and it
will never raise a `LookupError`.