twilio/flask-restful — pull request #103 by dougblack (2013-07-06 18:56:40+00:00)
Title: Python 3.3

This pull request resolves #62 by adding support for the latest version of Python: Python 3.3. The code now supports Python 2.6, Python 2.7, and Python 3.3 simultaneously, so users won't need to worry about multiple packages for different Pythons.

Many of the changes deal with converting code to match Python 3.3's new unicode support. The compatibility library `six` (http://pythonhosted.org/six/) was a great help here.

Tests *were* changed for two reasons.

1. Changes in Python 3.3 cause `response.data` to be of type `bytes` but string literals to be of type `unicode`. This clashes with Python 2.2, where `response.data` and string literals were both `str`. Since we compare `response.data` with string literals in tests, changes had to be made in the tests to make these comparisons work out.
2. The order of the keys in the expected output of tests involving marshaled output was not the same as the passed in `fields` dict. I'm not sure why, but these tests were failing under Python 3.3 but passing in Python 2.7. After the changes for this pull request were made, these tests pass for both versions.

For a more nuanced explanation of changes, I encourage reviewers to read the #62.